fschwartzer commited on
Commit
7673c97
1 Parent(s): 0df2b89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -20
app.py CHANGED
@@ -147,10 +147,6 @@ evo_html = """
147
  """
148
 
149
 
150
- import streamlit as st
151
-
152
- import streamlit as st
153
-
154
  # Create a sidebar for controls
155
  with st.sidebar:
156
  st.markdown(title_html, unsafe_allow_html=True)
@@ -259,6 +255,19 @@ filtered_data['Predicted_target'] = predicted_target
259
  with st.container():
260
  st.map(filtered_data, zoom=zoom_level, use_container_width=True)
261
  st.write("Dados:", filtered_data) # Debug: Print filtered_data
 
 
 
 
 
 
 
 
 
 
 
 
 
262
 
263
  k_threshold = 5
264
 
@@ -295,19 +304,4 @@ if 'Predicted_target' in filtered_data.columns and not np.all(predicted_target =
295
  st.write(f"Valor médio (Reais/m²) para as características selecionadas: ${mean_value:.2f}$ Reais")
296
  st.write(f"Os valores podem variar entre ${lower_bound:.2f}$ e ${higher_bound:.2f}$ Reais, dependendo das características dos imóveis.")
297
  else:
298
- st.warning(f"**Dados insuficientes para inferência do valor. Mínimo necessário:** {k_threshold}")
299
-
300
- # Display the map for features
301
- with st.container():
302
- folium_layermap = folium.Map(location=[custom_lat, custom_lon], zoom_start=zoom_level, control_scale=True)
303
-
304
- # Add heatmap layers for 'Valor_Urb', 'Valor_Eqp', and 'RENDA'
305
- add_heatmap_layer(folium_layermap, filtered_data, 'Valor_Urb', 'RdBu_r')
306
- add_heatmap_layer(folium_layermap, filtered_data, 'Valor_Eqp', 'RdBu_r')
307
- add_heatmap_layer(folium_layermap, filtered_data, 'RENDA', 'RdBu_r')
308
-
309
- # Add layer control
310
- folium.LayerControl().add_to(folium_layermap)
311
-
312
- # Display the map using st_folium
313
- st_folium(folium_layermap, width="100%", height="100%")
 
147
  """
148
 
149
 
 
 
 
 
150
  # Create a sidebar for controls
151
  with st.sidebar:
152
  st.markdown(title_html, unsafe_allow_html=True)
 
255
  with st.container():
256
  st.map(filtered_data, zoom=zoom_level, use_container_width=True)
257
  st.write("Dados:", filtered_data) # Debug: Print filtered_data
258
+
259
+ folium_layermap = folium.Map(location=[custom_lat, custom_lon], zoom_start=zoom_level, control_scale=True)
260
+
261
+ # Add heatmap layers for 'Valor_Urb', 'Valor_Eqp', and 'RENDA'
262
+ add_heatmap_layer(folium_layermap, filtered_data, 'Valor_Urb', 'RdBu_r')
263
+ add_heatmap_layer(folium_layermap, filtered_data, 'Valor_Eqp', 'RdBu_r')
264
+ add_heatmap_layer(folium_layermap, filtered_data, 'RENDA', 'RdBu_r')
265
+
266
+ # Add layer control
267
+ folium.LayerControl().add_to(folium_layermap)
268
+
269
+ # Display the map using st_folium
270
+ st_folium(folium_layermap, width="100%", height="100%")
271
 
272
  k_threshold = 5
273
 
 
304
  st.write(f"Valor médio (Reais/m²) para as características selecionadas: ${mean_value:.2f}$ Reais")
305
  st.write(f"Os valores podem variar entre ${lower_bound:.2f}$ e ${higher_bound:.2f}$ Reais, dependendo das características dos imóveis.")
306
  else:
307
+ st.warning(f"**Dados insuficientes para inferência do valor. Mínimo necessário:** {k_threshold}")