azrai99 commited on
Commit
09ac12e
·
verified ·
1 Parent(s): 8c26465

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +49 -0
app.py CHANGED
@@ -525,6 +525,31 @@ def timegpt_fcst():
525
  time_taken = end_time - start_time
526
  st.success(f"Time taken for TimeGPT forecast: {time_taken:.2f} seconds")
527
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
528
 
529
 
530
  def timegpt_anom():
@@ -602,7 +627,31 @@ def timegpt_anom():
602
  end_time = time.time() # End timing
603
  time_taken = end_time - start_time
604
  st.success(f"Time taken for TimeGPT forecast: {time_taken:.2f} seconds")
 
 
 
605
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
606
 
607
 
608
 
 
525
  time_taken = end_time - start_time
526
  st.success(f"Time taken for TimeGPT forecast: {time_taken:.2f} seconds")
527
 
528
+ if 'forecast_df' in st.session_state:
529
+ forecast_df = st.session_state.forecast_df
530
+
531
+ st.markdown('You can download Input and Forecast Data below')
532
+ tab_insample, tab_forecast = st.tabs(
533
+ ["Input data", "Forecast"]
534
+ )
535
+
536
+ with tab_insample:
537
+ df_grid = df.drop(columns="unique_id")
538
+ st.write(df_grid)
539
+ # grid_table = AgGrid(
540
+ # df_grid,
541
+ # theme="alpine",
542
+ # )
543
+
544
+ with tab_forecast:
545
+ if model_choice in forecast_results:
546
+ df_grid = forecast_df
547
+ st.write(df_grid)
548
+ # grid_table = AgGrid(
549
+ # df_grid,
550
+ # theme="alpine",
551
+ # )
552
+
553
 
554
 
555
  def timegpt_anom():
 
627
  end_time = time.time() # End timing
628
  time_taken = end_time - start_time
629
  st.success(f"Time taken for TimeGPT forecast: {time_taken:.2f} seconds")
630
+
631
+ if 'forecast_df' in st.session_state:
632
+ forecast_df = st.session_state.forecast_df
633
 
634
+ st.markdown('You can download Input and Forecast Data below')
635
+ tab_insample, tab_forecast = st.tabs(
636
+ ["Input data", "Forecast"]
637
+ )
638
+
639
+ with tab_insample:
640
+ df_grid = df.drop(columns="unique_id")
641
+ st.write(df_grid)
642
+ # grid_table = AgGrid(
643
+ # df_grid,
644
+ # theme="alpine",
645
+ # )
646
+
647
+ with tab_forecast:
648
+ if model_choice in forecast_results:
649
+ df_grid = forecast_df
650
+ st.write(df_grid)
651
+ # grid_table = AgGrid(
652
+ # df_grid,
653
+ # theme="alpine",
654
+ # )
655
 
656
 
657