This repository contains the code used for the experiment and analysis of our paper : Forecasting Electricity Prices: an Optimize then Predict-based approach.
- Clone this project.
- Install dependancies listed in
setup.py
(python > 3). - Download data from the archive. Place the data folder at the root of it.
5 scripts are available :
run_optimize_flows.py
: ComputesFlin
,Flsq
,Fcmb
,Fos
run_grid_search.py
: Evaluates hyper-parameters combinations. Will produceresults.csv
files in the Grid Search folder.run_recalibration.py
: Forecasts prices using recalibration. Will producepredictions.csv
files in the Predictions folder.run_shap_values.py
: Computes shap values for the first 30 days of the test set. Will produceshap_values.npy
files in the Shap Values folder.run_analysis.py
: Computes metrics, performs DM tests and plots shap values.
We recommend to execute those scripts in the terminal using the python or ipython interpreters, as results are not displayed. Moreover, generating flow estimations, grid search, recalibration and shap values is long (several days).