[BUG] Some global forecasting models seem to produce the same values for all samples
See original GitHub issueDescribe the bug Some global forecasting models produce the same value for all samples when predicting with multiple samples.
To Reproduce
Run the example provided on the start page, but exchange ExponentialSmoothing
for e.g. TransformerModel
, NBeatsModel
:
import pandas as pd
from darts import TimeSeries
# Read a pandas DataFrame
df = pd.read_csv('AirPassengers.csv', delimiter=",")
# Create a TimeSeries, specifying the time and value columns
series = TimeSeries.from_dataframe(df, 'Month', '#Passengers')
# Set aside the last 36 months as a validation series
train, val = series[:-36], series[-36:]
from darts.models import ExponentialSmoothing, TransformerModel, NBEATSModel
# model = ExponentialSmoothing()
model = NBEATSModel(3, 3, n_epochs=1)
model.fit(train)
prediction = model.predict(len(val), num_samples=1000)
print(prediction)
import matplotlib.pyplot as plt
series.plot()
prediction.plot(label='forecast', low_quantile=0.05, high_quantile=0.95)
plt.legend()
plt.show()
The printed prediction shows that all produced predicted samples are of the same value.
Expected behavior The produced samples should diverge in value.
System (please complete the following information):
- Python version: 3.7.10
- darts version: 0.12.0
Additional context Not sure whether this is a bug or incorrect usage on my part, but couldn’t find anything in the documentation w.r.t. this.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Training Forecasting Models on Multiple Time Series with Darts
All the deep learning forecasting models implemented in Darts as well as RegressionModel are global forecasting models. This means that these models can...
Read more >Multiple Time Series, Pre-trained Models and Covariates
Global Forecasting Models ¶ · Past Covariates denote time series whose past values are known at prediction time. These are usually things that...
Read more >Explaining Bad Forecasts in Global Time Series Models - MDPI
Such models make the strong assumption that some relationship exists between time series, though the forecasts are independent of each other [11].
Read more >Searching for the Best Forecasting Model: A Comparison of ...
There are two basic models in univariate forecasting. The first is the autoregressive model which makes use of past values of the forecast ......
Read more >How to Select a Model For Your Time Series Prediction Task ...
Working with time series data? Here's a guide for you. In this article, you will learn how to compare and select time series...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Actually
TransformerModel
does support probabilistic forecasting now (the table hasn’t yet been updated). Basically all neural network models support likelihood models, exceptNBEATSModel
.Great, thanks for the quick and helpful response! Closing this, as this is no bug.