fschwartzer commited on
Commit
4188e65
1 Parent(s): 8a967e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -17
app.py CHANGED
@@ -12,6 +12,8 @@ import base64
12
  from io import BytesIO
13
  import sys
14
  import pydeck as pdk
 
 
15
 
16
  # Print the Python version
17
  print("Python version")
@@ -203,7 +205,7 @@ filtered_data['Predicted_target'] = predicted_target
203
 
204
 
205
  # Set custom width for columns
206
- tab1, tab2, tab3, tab4 = st.tabs(["Mapa", "Planilha", "Variáveis", "Inteligência Artificial"])
207
 
208
  with tab1:
209
  # Define a PyDeck view state for the initial map view
@@ -252,21 +254,7 @@ with tab2:
252
  download_placeholder = st.empty()
253
  download_placeholder.markdown(href, unsafe_allow_html=True)
254
 
255
- with tab3:
256
- folium_layermap = folium.Map(location=[custom_lat, custom_lon], tiles="Cartodb Positron", zoom_start=14)
257
-
258
- # Add heatmap layers for 'Valor_Urb', 'Valor_Eqp', and 'RENDA'
259
- add_heatmap_layer(folium_layermap, filtered_data, 'Valor_Urb', 'RdBu_r')
260
- add_heatmap_layer(folium_layermap, filtered_data, 'Valor_Eqp', 'RdBu_r')
261
- add_heatmap_layer(folium_layermap, filtered_data, 'RENDA', 'RdBu_r')
262
-
263
- # Add layer control
264
- folium.LayerControl().add_to(folium_layermap)
265
-
266
- # Display the map using st_folium
267
- st_folium(folium_layermap, width=1200, height=400)
268
-
269
- with tab4:
270
  k_threshold = 5
271
 
272
  # Function to perform bootstrap on the predicted target values
@@ -302,4 +290,8 @@ with tab4:
302
  st.write(f"Valor médio (Reais/m²) para as características selecionadas: ${mean_value:.2f}$ Reais")
303
  st.write(f"Os valores podem variar entre ${lower_bound:.2f}$ e ${higher_bound:.2f}$ Reais, dependendo das características dos imóveis.")
304
  else:
305
- st.warning(f"**Dados insuficientes para inferência do valor. Mínimo necessário:** {k_threshold}")
 
 
 
 
 
12
  from io import BytesIO
13
  import sys
14
  import pydeck as pdk
15
+ from ydata_profiling import ProfileReport
16
+ import streamlit.components.v1 as components
17
 
18
  # Print the Python version
19
  print("Python version")
 
205
 
206
 
207
  # Set custom width for columns
208
+ tab1, tab2, tab3= st.tabs(["Mapa", "Planilha", "Análise dos Dados"])
209
 
210
  with tab1:
211
  # Define a PyDeck view state for the initial map view
 
254
  download_placeholder = st.empty()
255
  download_placeholder.markdown(href, unsafe_allow_html=True)
256
 
257
+ with tab3:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  k_threshold = 5
259
 
260
  # Function to perform bootstrap on the predicted target values
 
290
  st.write(f"Valor médio (Reais/m²) para as características selecionadas: ${mean_value:.2f}$ Reais")
291
  st.write(f"Os valores podem variar entre ${lower_bound:.2f}$ e ${higher_bound:.2f}$ Reais, dependendo das características dos imóveis.")
292
  else:
293
+ st.warning(f"**Dados insuficientes para inferência do valor. Mínimo necessário:** {k_threshold}")
294
+
295
+ profile = ProfileReport(filtered_data, title="Pandas Profiling Report", explorative=True)
296
+ profile_html = profile.to_html()
297
+ components.html(profile_html, height=500, scrolling=True)