fschwartzer commited on
Commit
0424154
1 Parent(s): 971496c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -4
app.py CHANGED
@@ -124,7 +124,7 @@ title_html = """
124
  </style>
125
  <span style='color: #566f71; font-size: 50px;'>aval</span>
126
  <span style='color: #edb600; font-size: 50px;'>ia</span>
127
- <span style='color: #566f71; font-size: 50px;'>.NEXUS</span>
128
  """
129
 
130
  # Set font to 'Quicksand' for factor_html
@@ -306,7 +306,26 @@ with st.container():
306
  download_placeholder = st.empty()
307
  download_placeholder.markdown(href, unsafe_allow_html=True)
308
 
309
- folium_layermap = folium.Map(location=[custom_lat, custom_lon], zoom_start=zoom_level, control_scale=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
 
311
  # Add heatmap layers for 'Valor_Urb', 'Valor_Eqp', and 'RENDA'
312
  add_heatmap_layer(folium_layermap, filtered_data, 'Valor_Urb', 'RdBu_r')
@@ -317,7 +336,7 @@ with st.container():
317
  folium.LayerControl().add_to(folium_layermap)
318
 
319
  # Display the map using st_folium
320
- st_folium(folium_layermap, width=900, height=350)
321
 
322
  k_threshold = 5
323
 
@@ -350,7 +369,7 @@ if 'Predicted_target' in filtered_data.columns and not np.all(predicted_target =
350
  mean_value = np.mean(filtered_data['Predicted_target'])
351
 
352
  # Display the results with custom styling
353
- st.markdown("## **Resultado da Análise Estatística**")
354
  st.write(f"Valor médio (Reais/m²) para as características selecionadas: ${mean_value:.2f}$ Reais")
355
  st.write(f"Os valores podem variar entre ${lower_bound:.2f}$ e ${higher_bound:.2f}$ Reais, dependendo das características dos imóveis.")
356
  else:
 
124
  </style>
125
  <span style='color: #566f71; font-size: 50px;'>aval</span>
126
  <span style='color: #edb600; font-size: 50px;'>ia</span>
127
+ <span style='color: #566f71; font-size: 50px;'>.se</span>
128
  """
129
 
130
  # Set font to 'Quicksand' for factor_html
 
306
  download_placeholder = st.empty()
307
  download_placeholder.markdown(href, unsafe_allow_html=True)
308
 
309
+
310
+ def add_heatmap_layer(folium_layermap, data, column, colormap):
311
+ heatmap_layer = folium.plugins.HeatMap(data=data[['latitude', 'longitude', column]],
312
+ min_opacity=0.5,
313
+ max_zoom=18,
314
+ radius=25, blur=15,
315
+ gradient=None,
316
+ overlay=True,
317
+ control=True,
318
+ show=True,
319
+ colormap=colormap)
320
+ folium_layermap.add_child(heatmap_layer)
321
+
322
+ # Create a Folium map centered on a specific location
323
+ folium_layermap = folium.Map(location=[latitude, longitude], zoom_start=12, tiles='Stamen Toner')
324
+
325
+ # Add grayscale tiles from OpenStreetMap
326
+ folium.TileLayer('https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}{r}.png',
327
+ attr='© Stadia Maps',
328
+ name='grayscale').add_to(folium_layermap)
329
 
330
  # Add heatmap layers for 'Valor_Urb', 'Valor_Eqp', and 'RENDA'
331
  add_heatmap_layer(folium_layermap, filtered_data, 'Valor_Urb', 'RdBu_r')
 
336
  folium.LayerControl().add_to(folium_layermap)
337
 
338
  # Display the map using st_folium
339
+ st.folium_chart(folium_layermap, width=1200, height=600)
340
 
341
  k_threshold = 5
342
 
 
369
  mean_value = np.mean(filtered_data['Predicted_target'])
370
 
371
  # Display the results with custom styling
372
+ st.markdown("## **Algoritmo **")
373
  st.write(f"Valor médio (Reais/m²) para as características selecionadas: ${mean_value:.2f}$ Reais")
374
  st.write(f"Os valores podem variar entre ${lower_bound:.2f}$ e ${higher_bound:.2f}$ Reais, dependendo das características dos imóveis.")
375
  else: