mmmapms commited on
Commit
9e2e619
1 Parent(s): deb692e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -29
app.py CHANGED
@@ -5,9 +5,12 @@ import plotly.graph_objs as go
5
  from io import BytesIO
6
  from datasets import load_dataset
7
 
8
- df = load_dataset("mmmapms/Forecasts")
9
 
10
- df = df.rename(columns={
 
 
 
 
11
  'Price': 'Real Price',
12
  'DNN1': 'Neural Network 1',
13
  'DNN2': 'Neural Network 2',
@@ -21,33 +24,12 @@ df = df.rename(columns={
21
  'LEAR_Ensemble': 'Regularized Linear Model Ensemble',
22
  'Persis': 'Persistence Model',
23
  'Hybrid_Ensemble': 'Hybrid Ensemble'
24
- })
25
- df['Date'] = pd.to_datetime(df['Date'], dayfirst=True)
26
- df_filtered = df.dropna(subset=['Real Price'])
27
-
28
- #@st.cache_data
29
- #def load_data_predictions():
30
- # df = pd.read_csv('Predictions.csv')
31
- # df = df.rename(columns={
32
- # 'Price': 'Real Price',
33
- # 'DNN1': 'Neural Network 1',
34
- # 'DNN2': 'Neural Network 2',
35
- # 'DNN3': 'Neural Network 3',
36
- # 'DNN4': 'Neural Network 4',
37
- # 'DNN_Ensemble': 'Neural Network Ensemble',
38
- # 'LEAR56': 'Regularized Linear Model 1',
39
- # 'LEAR84': 'Regularized Linear Model 2',
40
- # 'LEAR112': 'Regularized Linear Model 3',
41
- # 'LEAR730': 'Regularized Linear Model 4',
42
- # 'LEAR_Ensemble': 'Regularized Linear Model Ensemble',
43
- # 'Persis': 'Persistence Model',
44
- # 'Hybrid_Ensemble': 'Hybrid Ensemble'
45
- #})
46
- # df['Date'] = pd.to_datetime(df['Date'], dayfirst=True)
47
- # df_filtered = df.dropna(subset=['Real Price'])
48
- # return df, df_filtered
49
-
50
- #df, df_filtered = load_data_predictions()
51
 
52
  min_date_allowed_pred = df_filtered['Date'].min().date()
53
  max_date_allowed_pred = df_filtered['Date'].max().date()
 
5
  from io import BytesIO
6
  from datasets import load_dataset
7
 
 
8
 
9
+
10
+ @st.cache_data
11
+ def load_data_predictions():
12
+ df = pd.read_csv('Predictions.csv')
13
+ df = df.rename(columns={
14
  'Price': 'Real Price',
15
  'DNN1': 'Neural Network 1',
16
  'DNN2': 'Neural Network 2',
 
24
  'LEAR_Ensemble': 'Regularized Linear Model Ensemble',
25
  'Persis': 'Persistence Model',
26
  'Hybrid_Ensemble': 'Hybrid Ensemble'
27
+ })
28
+ df['Date'] = pd.to_datetime(df['Date'], dayfirst=True)
29
+ df_filtered = df.dropna(subset=['Real Price'])
30
+ return df, df_filtered
31
+
32
+ df, df_filtered = load_data_predictions()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  min_date_allowed_pred = df_filtered['Date'].min().date()
35
  max_date_allowed_pred = df_filtered['Date'].max().date()