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.91k stars 857 forks source link

Forecast issue #779

Closed mandar-avhad closed 2 years ago

mandar-avhad commented 2 years ago

Screenshot from 2022-02-10 00-15-40

Screenshot from 2022-02-10 00-18-51

I getting the above forecasts. The first is for RNN and the second is for NBEATS model. Can anyone suggest what this issue might be?

My model training code: For RNN

`model = RNNModel(input_chunk_length=16, output_chunk_length=12) model.fit(train) prediction = model.predict(800)

Series.plot(label = 'actual') prediction.plot(label = 'forecast', lw = 3) plt.legend()`


For NBEATS

`model = NBEATSModel(input_chunk_length=16, output_chunk_length=12) model.fit(train) prediction = model.predict(800)

Series.plot(label = 'actual') prediction.plot(label = 'forecast', lw = 3) plt.legend()`

Please suggest the best way to do this. Also, suggest a method to do multivariate forecasting (using features other than target for forecasting). An example would be great. Thanks!

analyticray commented 2 years ago

We have a similar issue. Any solution to this?

lujaini7 commented 2 years ago

I also have similar issue regarding this matter. Please solve this issue. So headache..

brunnedu commented 2 years ago

Hi @mandar-avhad, when using deep learning models, it is recommended to scale the train series before fitting the model (standardize, normalize), then predict the desired forecast horizon, and after that inverse scale the predictions back to the original size. For this darts provides the Scaler object that allows you to scale your series of any format (TimeSeries or Sequence[TimeSeries]) using any sklearn scaler such as StandardScaler or MinMaxScaler. For some examples you can also have a look at the RNN example notebook or the NBeats example notebook.