unit8co / darts

A python library for user-friendly forecasting and anomaly detection on time series.
https://unit8co.github.io/darts/
Apache License 2.0
7.56k stars 829 forks source link

Error importing RNN Model #2431

Open ETTAN93 opened 1 week ago

ETTAN93 commented 1 week ago

Hi,

Two questions on my side:

1. Importing RNN Model I have upgraded my Darts version to the latest, i.e. 0.30.0 image

When trying to import RNNModel, one of the underlying imports seem to not be working. image

Am I importing something incorrectly?

  1. Example RNN Notebook

Looking at the example in github, I noticed that the dataset was first split into a train and test set (called val_en) in the notebook. The RNN model is then fitted on the train set and validated on the test set. The best performing model is then loaded and used to do a historical forecast with the same train and test split. Would this not result in inaccurate metrics (data leakage) since the test set used to fit the model and then used to run historical forecast is the same test set?

dennisbader commented 4 days ago

From a first glance, it looks to me like something went wrong in the installation. Can you try re-installing darts from scratch in a new environment?

And for the torch model support, you need "u8darts[all]", "u8darts[torch]", or "darts".

ETTAN93 commented 2 days ago

@dennisbader thanks. uninstalling and reinstalling with u8darts[all] seemed to have solved the problem.

Looking at the example notebook for deepAR in GitHub, I noticed that the dataset was first split into a train and test set (called val_en) in the notebook. The RNN model is then fitted on the train set and validated on the test set. The best performing model is then loaded and used to do a historical forecast with the same train and test split. Would this not result in inaccurate metrics (data leakage) since the test set used to fit the model and then used to run historical forecast is the same test set?