-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathconfig.yml
235 lines (229 loc) · 6.6 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# Relevant file/directory paths
PATHS:
RAW_DATA_DIR: 'data/raw/quarterly/'
RAW_DATASET: 'data/raw/intermediate/all/raw_data.csv'
FULL_RAW_DATASET: 'data/raw/full_raw_data.csv'
PREPROCESSED_DATA: 'data/preprocessed/all/preprocessed_data.csv'
CLIENT_DATA: 'data/preprocessed/client_data.csv'
CAT_FEAT_MAP: 'data/serializations/cat_feat_map.yml'
MODELS: 'results/models/'
DATA_VISUALIZATIONS: 'img/data_visualizations/'
FORECAST_VISUALIZATIONS: 'img/forecast_visualizations/'
EXPERIMENT_VISUALIZATIONS: 'img/experiment_visualizations/'
INTERPRETABILITY_VISUALIZATIONS: 'img/interpretability_visualizations/'
LOGS: 'results\\logs\\'
EXPERIMENTS: 'results/experiments/'
TRAIN_SET: 'data/preprocessed/Train_Set.csv'
TEST_SET: 'data/preprocessed/Test_Set.csv'
SCALER_COL_TRANSFORMER: 'data/serializations/scaler_col_transformer.bin'
ORDINAL_COL_TRANSFORMER: 'data/serializations/ordinal_col_transformer.bin'
OHE_COL_TRANSFORMER: 'data/serializations/ohe_transformer_sv.bin'
PREDICTIONS: './results/predictions/'
INTERPRETABILITY: './results/interpretability/'
K-PROTOTYPES_CENTROIDS: 'results/experiments/cluster_centroids_'
K-PROTOTYPES_CLUSTERS: 'results/experiments/client_clusters_'
IMAGES: './img/visualizations/'
SERIALIZATIONS: './data/serializations/'
# Constants describing data
DATA:
NUMERICAL_FEATS: ['PARCEL_AREA', 'SSF', 'REDUC_FAC', 'NOM', 'BILLING_AREA', 'W_HEC_AF', 'PREMISE_UNITS']
CATEGORICAL_FEATS: ['RATE_CLASS', 'METER_SIZE', 'INST_TYPE', 'EST_READ']
BOOLEAN_FEATS: ['SERVICE_STATUS', 'RES_LDM', 'RES_MDM', 'RES_HR', 'S90MT', 'FIRE_PROT_CHARGE_EXEMPT',
'CUST_ASST_PROG_EXEMPT', 'STORM_CHARGE_EX', 'SAN_CHARGE_EX', 'WATER_CHARGE_EX']
TEST_FRAC: 0.1
TEST_DAYS: 183
START_TRIM: 242
END_TRIM: 50
MISSING_RANGES: [['2014-03-01', '2014-09-30'], ['2017-03-25', '2017-05-31'], ['2021-09-02', '2021-11-17']]
MERGED_DATA_YEARS: 5
# Training experiments
TRAIN:
MODEL: 'prophet' # One of ['prophet', 'lstm', 'gru', '1dcnn', 'arima', 'sarimax', 'random_forest', 'linear_regression']
EXPERIMENT: 'train_single' # One of ['train_single', 'train_all', 'hparam_search', 'cross_validation']
N_QUANTILES: 10
N_FOLDS: 5
HPARAM_SEARCH:
N_EVALS: 500
HPARAM_OBJECTIVE: 'MAPE' # One of ['MAPE', 'MAE', 'MSE', 'RMSE']
LAST_FOLDS: 4
INTERPRETABILITY: true
# Forecasting
FORECAST:
MODEL: 'prophet' # One of ['prophet', 'lstm', 'gru', '1dcnn', 'arima', 'sarimax', 'random_forest', 'linear_regression']
MODEL_PATH: './results/models/Prophet.pkl'
DAYS: 2000
# Hyperparameters specific to individual models
HPARAMS:
PROPHET:
COUNTRY: 'CA'
CHANGEPOINT_PRIOR_SCALE: 0.001
SEASONALITY_PRIOR_SCALE: 0.01
HOLIDAYS_PRIOR_SCALE: 0.01
SEASONALITY_MODE: 'additive'
CHANGEPOINT_RANGE: 0.8
HOLIDAYS:
Family Day: ['2008-02-18', '2009-02-16', '2010-02-15', '2011-02-21', '2012-02-20', '2013-02-18', '2014-02-17',
'2015-02-16', '2016-02-15', '2017-02-20', '2018-02-19', '2019-02-18', '2020-02-17', '2021-02-15',
'2022-02-21', '2023-02-20', '2024-02-19', '2025-02-17', '2026-02-16', '2027-02-15', '2028-02-21',
'2029-02-19', '2030-02-18']
Civic Holiday: ['2008-08-04', '2009-08-03', '2010-08-02', '2011-08-01', '2012-08-06', '2013-08-05',
'2014-08-04', '2015-08-03', '2016-08-01', '2017-08-07', '2018-08-06', '2019-08-05',
'2020-08-03', '2021-08-02', '2022-08-01', '2023-08-07', '2024-08-05', '2025-08-04',
'2026-08-03', '2027-08-02', '2028-08-07', '2029-08-06', '2030-08-05']
ARIMA:
AUTO_PARAMS: false
P: 7
D: 1
Q: 30
SARIMAX:
AUTO_PARAMS: false
TREND_P: 7
TREND_D: 1
TREND_Q: 0
SEASONAL_P: 1
SEASONAL_D: 1
SEASONAL_Q: 0
M: 365
LSTM:
UNIVARIATE: true
T_X: 200
BATCH_SIZE: 32
EPOCHS: 500
PATIENCE: 15
VAL_FRAC: 0.1
LR: 0.00001
LOSS: 'mse'
UNITS: 4
DROPOUT: 0.0
FC0_UNITS: 64
FC1_UNITS: 64
GRU:
UNIVARIATE: true
T_X: 365
BATCH_SIZE: 32
EPOCHS: 500
PATIENCE: 10
VAL_FRAC: 0.1
LR: 0.001
LOSS: 'mse'
UNITS: 16
DROPOUT: 0.25
FC0_UNITS: 32
FC1_UNITS: 16
1DCNN:
UNIVARIATE: true
T_X: 180
BATCH_SIZE: 32
EPOCHS: 500
PATIENCE: 5
VAL_FRAC: 0.1
LR: 0.0003
LOSS: 'mae'
FILTERS: 16
KERNEL_SIZE: 3
STRIDE: 1
N_CONV_LAYERS: 2
FC0_UNITS: 64
FC1_UNITS: 32
DROPOUT: 0.0
LINEAR_REGRESSION:
UNIVARIATE: true
T_X: 300
RANDOM_FOREST:
UNIVARIATE: true
T_X: 365
N_ESTIMATORS: 100
LOSS: 'mse'
HPARAM_SEARCH:
PROPHET:
CHANGEPOINT_PRIOR_SCALE:
TYPE: 'float_log'
RANGE: [0.001, 0.5]
SEASONALITY_PRIOR_SCALE:
TYPE: 'float_log'
RANGE: [0.01, 10]
HOLIDAYS_PRIOR_SCALE:
TYPE: 'float_log'
RANGE: [0.01, 10]
SEASONALITY_MODE:
TYPE: 'set'
RANGE: ['additive', 'multiplicative']
LSTM:
T_X:
TYPE: 'int_uniform'
RANGE: [30, 365]
BATCH_SIZE:
TYPE: 'set'
RANGE: [16, 32]
PATIENCE:
TYPE: 'int_uniform'
RANGE: [5, 15]
LR:
TYPE: 'float_log'
RANGE: [0.00001, 0.001]
LOSS:
TYPE: 'set'
RANGE: ['mse', 'mae', 'huber_loss']
UNITS:
TYPE: 'set'
RANGE: [4, 8, 16]
DROPOUT:
TYPE: 'float_uniform'
RANGE: [0.0, 0.5]
FC0_UNITS:
TYPE: 'set'
RANGE: [32, 64, 128]
FC1_UNITS:
TYPE: 'set'
RANGE: [16, 32, 64]
1DCNN:
T_X:
TYPE: 'int_uniform'
RANGE: [30, 365]
BATCH_SIZE:
TYPE: 'set'
RANGE: [16, 32, 64]
PATIENCE:
TYPE: 'int_uniform'
RANGE: [5, 15]
LR:
TYPE: 'float_log'
RANGE: [0.00001, 0.001]
LOSS:
TYPE: 'set'
RANGE: ['mse', 'mae', 'huber_loss']
FILTERS:
TYPE: 'set'
RANGE: [4, 8, 16]
KERNEL_SIZE:
TYPE: 'set'
RANGE: [3, 5]
STRIDE:
TYPE: 'int_uniform'
RANGE: [1, 2]
N_CONV_LAYERS:
TYPE: 'int_uniform'
RANGE: [1, 3]
DROPOUT:
TYPE: 'float_uniform'
RANGE: [0.0, 0.5]
FC0_UNITS:
TYPE: 'set'
RANGE: [16, 32, 64]
FC1_UNITS:
TYPE: 'set'
RANGE: [8, 16, 32]
LINEAR_REGRESSION:
T_X:
TYPE: 'int_uniform'
RANGE: [30, 365]
# Data clustering
K-PROTOTYPES:
K: 4
N_RUNS: 15
N_JOBS: 3
K_MIN: 3
K_MAX: 12
FEATS_TO_EXCLUDE: ['RATE_CLASS', 'NOM', 'REDUC_FAC', 'SSF', 'W_HEC_AF', 'RES_LDM', 'RES_MDM', 'RES_HR']
EVAL_DATE: '2020-09-17'
EXPERIMENT: 'cluster_clients' # One of {'cluster_clients', 'silhouette_analysis'}