This dataset is supplied with two toolkits to perform all the computations necessary to obtain an evaluation according to the authors’ criteria. This toolkit is all the more relevant as the functions needed to obtain the test scores are not available in the standard Matlab toolkit or in the Python community library.
Two brief presentations are given here to illustrate the user-friendly tools that come with the dataset.
Matlab tools box
The matlab toolbox is available for idss
, idpoly
and custom user class (according to the toolbox abstract class).
For all three models, functions are available to visualise the prediction horizon, estimate the accuracy in relation to the prediction depth and calculate the scores. This toolkit also contains data directly available with the iddata
class for a user-friendly API.
Here we show an example with the ssest
estimation tools with a short section of the data set. Feel free to use the arx
function or other custom tools.
For this example, we first include the dataset with the toolbox.
|
|
Using the Matlab system identification toolkit, we can directly estimate a state space model.
|
|
After identifying the system, we can use the first function to obtain predictions according to a given observation size (here 22 steps) and a fixed prediction horizon (8 hours). The plot is available Figure 1.
|
|
We can then generate the accuracy w.r.t the prediction depth. This function can take (like all the function) a iddata
object.
The function result is available Figure 2.
|
|
Finally, we can generate the model score based on the test set and the predefined criteria.
|
|
This short example can be done with other models with the same API.
Python tools box
The python toolkit can make available dataset and run accuracy scores based on an 8-hour horizon prediction (like the Matlab version). Here we will show an example of use. For this example, we will use a basic first-order ARX model.
First, we need to include all the necessary libraries.
|
|
We can then download the data directly and select a section for demonstration purposes.
|
|
Then we define the following ARX model : $$ y[k] = Ay[k-1] + Bu[k-1]$$
This model predicts the complete horizon in an iterative way. For training the model, we use sklearn’s Lasso model to add regularisation.
|
|
The last part consists of redefining our model according to the API of the toolbox. For this we use the TimeSerieModel abstract class. It requires a prediction method that takes several experiments and runs all predictions.
|
|
We are now able to use all the tools in the benchmark. First, we can display several predictions (see Figure 3 and the code below).
|
|
We can also calculate the accuracy of the model per pool with another function (see code below and Figure 4).
|
|
We can finally calculate the reference score with the function get_benchmark_test_score
.
|
|