mmmapms commited on
Commit
5c85bea
1 Parent(s): 29ce4a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -6,7 +6,7 @@ import requests
6
  from io import StringIO
7
  import base64
8
 
9
- @st.cache(ttl=86400) # TTL is set for 86400 seconds (24 hours)
10
  def load_data_predictions(github_token):
11
 
12
  url = 'https://api.github.com/repos/mmmapms/Forecast_DAM_V2/contents/Predictions.csv'
@@ -95,9 +95,9 @@ st.title("Belgium: Electricity Price Forecasting")
95
  with st.sidebar:
96
  st.write("### Variables Selection for Graph")
97
  st.write("Select which variables you'd like to include in the graph. This will affect the displayed charts and available data for download.")
98
- selected_variables = st.multiselect("Select variables to display:", options=['Real Price', 'Neural Network 1', 'Neural Network 2', 'Neural Network 3', 'Neural Network 4', 'Neural Network Ensemble', 'Regularized Linear Model 1', 'Regularized Linear Model 2','Regularized Linear Model 3', 'Regularized Linear Model 4', 'Regularized Linear Model Ensemble', 'Hybrid Ensemble', 'Persistence Model'], default=['Real Price', 'Neural Network Ensemble', 'Regularized Linear Model Ensemble', 'Persistence Model'])
99
  st.write("### Model Selection for Scatter Plot")
100
- model_selection = st.selectbox("Select which model's predictions to display:", options=['Neural Network 1', 'Neural Network 2', 'Neural Network 3', 'Neural Network 4', 'Neural Network Ensemble', 'Regularized Linear Model 1', 'Regularized Linear Model 2','Regularized Linear Model 3', 'Regularized Linear Model 4', 'Regularized Linear Model Ensemble', 'Hybrid Ensemble', 'Persistence Model'], index=10) # Adjust the index as needed to default to your desired option
101
 
102
  st.write("### Date Range for Metrics Calculation")
103
  st.write("Select the date range to calculate the metrics for the predictions. This will influence the accuracy metrics displayed below. The complete dataset ranges from 10/03/2024 until today.")
@@ -158,9 +158,14 @@ if start_date_pred and end_date_pred:
158
  filtered_df = df_filtered[(df_filtered['Date'] >= pd.Timestamp(start_date_pred)) & (df_filtered['Date'] <= pd.Timestamp(end_date_pred))]
159
 
160
  # List of models for convenience
 
 
 
 
 
161
  models = [
162
- 'Neural Network 1', 'Neural Network 2', 'Neural Network 3', 'Neural Network 4', 'Neural Network Ensemble',
163
- 'Regularized Linear Model 1', 'Regularized Linear Model 2', 'Regularized Linear Model 3', 'Regularized Linear Model 4', 'Regularized Linear Model Ensemble',
164
  'Persistence Model', 'Hybrid Ensemble'
165
  ]
166
 
 
6
  from io import StringIO
7
  import base64
8
 
9
+ @st.cache_data(ttl=86400) # TTL is set for 86400 seconds (24 hours)
10
  def load_data_predictions(github_token):
11
 
12
  url = 'https://api.github.com/repos/mmmapms/Forecast_DAM_V2/contents/Predictions.csv'
 
95
  with st.sidebar:
96
  st.write("### Variables Selection for Graph")
97
  st.write("Select which variables you'd like to include in the graph. This will affect the displayed charts and available data for download.")
98
+ selected_variables = st.multiselect("Select variables to display:", ['Real Price', 'Neural Network 1', 'Neural Network 2', 'Neural Network 3', 'Neural Network 4', 'Regularized Linear Model 1', 'Regularized Linear Model 2','Regularized Linear Model 3', 'Regularized Linear Model 4', 'Hybrid Ensemble', 'Persistence Model'], default=['Real Price','Neural Network 4', 'Regularized Linear Model 4', 'Persistence Model'])#options=['Real Price', 'Neural Network 1', 'Neural Network 2', 'Neural Network 3', 'Neural Network 4', 'Neural Network Ensemble', 'Regularized Linear Model 1', 'Regularized Linear Model 2','Regularized Linear Model 3', 'Regularized Linear Model 4', 'Regularized Linear Model Ensemble', 'Hybrid Ensemble', 'Persistence Model'], default=['Real Price', 'Neural Network Ensemble', 'Regularized Linear Model Ensemble', 'Persistence Model'])
99
  st.write("### Model Selection for Scatter Plot")
100
+ model_selection = st.selectbox("Select which model's predictions to display:", options=['Neural Network 1', 'Neural Network 2', 'Neural Network 3', 'Neural Network 4', 'Regularized Linear Model 1', 'Regularized Linear Model 2','Regularized Linear Model 3', 'Regularized Linear Model 4', 'Hybrid Ensemble', 'Persistence Model'], index=10)#options=['Neural Network 1', 'Neural Network 2', 'Neural Network 3', 'Neural Network 4', 'Neural Network Ensemble', 'Regularized Linear Model 1', 'Regularized Linear Model 2','Regularized Linear Model 3', 'Regularized Linear Model 4', 'Regularized Linear Model Ensemble', 'Hybrid Ensemble', 'Persistence Model'], index=10) # Adjust the index as needed to default to your desired option
101
 
102
  st.write("### Date Range for Metrics Calculation")
103
  st.write("Select the date range to calculate the metrics for the predictions. This will influence the accuracy metrics displayed below. The complete dataset ranges from 10/03/2024 until today.")
 
158
  filtered_df = df_filtered[(df_filtered['Date'] >= pd.Timestamp(start_date_pred)) & (df_filtered['Date'] <= pd.Timestamp(end_date_pred))]
159
 
160
  # List of models for convenience
161
+ #models = [
162
+ # 'Neural Network 1', 'Neural Network 2', 'Neural Network 3', 'Neural Network 4', 'Neural Network Ensemble',
163
+ # 'Regularized Linear Model 1', 'Regularized Linear Model 2', 'Regularized Linear Model 3', 'Regularized Linear Model 4', 'Regularized Linear Model Ensemble',
164
+ # 'Persistence Model', 'Hybrid Ensemble'
165
+ #]
166
  models = [
167
+ 'Neural Network 1', 'Neural Network 2', 'Neural Network 3', 'Neural Network 4',
168
+ 'Regularized Linear Model 1', 'Regularized Linear Model 2', 'Regularized Linear Model 3', 'Regularized Linear Model 4',
169
  'Persistence Model', 'Hybrid Ensemble'
170
  ]
171