fschwartzer commited on
Commit
d9189c2
·
1 Parent(s): 87c4391

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -224,7 +224,12 @@ with st.container():
224
  st.map(filtered_data, zoom=zoom_level, use_container_width=True)
225
  st.write("Dados:", filtered_data) # Debug: Print filtered_data
226
 
227
- # Display the predicted V_oferta values if applicable
228
- if 'Predicted_V_oferta' in filtered_data.columns:
 
 
 
229
  st.write("Valores (R$/m²) previstos com algoritmo KNN:")
230
- st.write(filtered_data[['latitude', 'longitude', 'V_oferta', 'Predicted_V_oferta']])
 
 
 
224
  st.map(filtered_data, zoom=zoom_level, use_container_width=True)
225
  st.write("Dados:", filtered_data) # Debug: Print filtered_data
226
 
227
+ # Set the threshold (k) for the number of data points
228
+ k_threshold = 5 # Adjust the threshold as needed
229
+
230
+ # Display the predicted Predicted_target values if applicable and above the threshold
231
+ if 'Predicted_target' in filtered_data.columns and len(filtered_data) > k_threshold:
232
  st.write("Valores (R$/m²) previstos com algoritmo KNN:")
233
+ st.write(filtered_data[['Localização', 'Atotal', 'Apriv', 'Vunit_total', 'Vunit_priv', 'Predicted_target']])
234
+ else:
235
+ st.warning(f"Dados insuficientes para inferência do valor. Mínimo necessário: {k_threshold}")