Alvianojs commited on
Commit
1b0480c
·
1 Parent(s): 8855170

Update app.py

Browse files

add Predictive Traffic Map

Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -5,6 +5,7 @@ from datasets import load_dataset
5
  import os
6
  from src.basic_plot import basic_chart
7
  from src.map_viz import calling_map_viz
 
8
  from src.data_ingestion import daily_average
9
  from src.heatmap import HeatMap
10
  from src.data_ingestion import remove_previous_view, merge_volumes
@@ -91,6 +92,9 @@ def main():
91
  st.plotly_chart(heatmap.update_day_bar_chart(day_choice))
92
 
93
  else:
 
 
 
94
 
95
  figs = gen_fig()
96
  today = get_today()
@@ -114,5 +118,9 @@ def main():
114
  starter_variables = [x_train, str(d), pred_hour_choice, pred_view_choice]
115
  st.plotly_chart(predicted_figure(clf, starter_variables, figs))
116
 
 
 
 
 
117
  if __name__ == "__main__":
118
  main()
 
5
  import os
6
  from src.basic_plot import basic_chart
7
  from src.map_viz import calling_map_viz
8
+ from src.map_viz_pred import calling_pred_map_viz
9
  from src.data_ingestion import daily_average
10
  from src.heatmap import HeatMap
11
  from src.data_ingestion import remove_previous_view, merge_volumes
 
92
  st.plotly_chart(heatmap.update_day_bar_chart(day_choice))
93
 
94
  else:
95
+
96
+ st.sidebar.markdown("Select Plots to show")
97
+ checkbox_two_pred = st.sidebar.checkbox('Predictive Traffic Map', value = True)
98
 
99
  figs = gen_fig()
100
  today = get_today()
 
118
  starter_variables = [x_train, str(d), pred_hour_choice, pred_view_choice]
119
  st.plotly_chart(predicted_figure(clf, starter_variables, figs))
120
 
121
+ if checkbox_two_pred:
122
+ st.subheader("Predictive Traffic Map")
123
+ st.pyplot(calling_pred_map_viz(counts_df))
124
+
125
  if __name__ == "__main__":
126
  main()