===================================================
README
===================================================
* Dependencies:

- Java 1.8
- Postgres 9.3
- Matlab
===================================================
* Execution steps

1) Import the provided datasets using the \i command from pgadmin console;
2) Configure database credentials in config.properties; 
3) Remove comments ("#") from config.properties for the chosen dataset and learning setting.

For example, to invoke TUCKER_CLUS using rank=2 for the Tucker decomposition, remove comments on the following lines:
______________________

dataset=PV_ITALY
multiPlant=1
plantAtt=idsito
startH=2
endH=20
dateField=data

rank=2
table=it_dataset_complete
setting=202
numTargets=1
variant=hourly
______________________

4) Invoke the algorithm as in the scripts provided in the scripts file. 

Please note that the first invocation should include "-init" in order to create the tables responsible for storing the predictions and the errors.

For example, the following command runs the algorithm repeatedly using the dates of the split #2 (subfolder dates) as test dates, with a training sliding window of 30 days:

java -jar dm-toolkit.jar -alg TUCKER_CLUS -windowSize 30 -run 2 -init > out.log

Predictions and errors will be stored in separate tables in the database ("dm_errors","dm_predictions").

Results can be extracted with a query. For example, the following query allows to extract the average prediction errors (RMSE) for each dataset, algorithm and learning setting:

SELECT dataset, algorithm, setting, avg(rmse)as rmse, count(*) FROM dm_errors 
GROUP BY dataset, algorithm, setting;
