question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Some global forecasting models seem to produce the same values for all samples

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hrzncommented, Oct 4, 2021

Actually TransformerModel does support probabilistic forecasting now (the table hasn’t yet been updated). Basically all neural network models support likelihood models, except NBEATSModel.

0reactions
rmitschcommented, Oct 4, 2021

Great, thanks for the quick and helpful response! Closing this, as this is no bug.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found