Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] .backtest method is not working #1516

Closed
mrsergazinov opened this issue Jan 25, 2023 · 1 comment · Fixed by #1517
Closed

[BUG] .backtest method is not working #1516

mrsergazinov opened this issue Jan 25, 2023 · 1 comment · Fixed by #1517
Labels
bug Something isn't working

Comments

@mrsergazinov
Copy link

Describe the bug
Type mismatch in the .backtest method due to a typo in the for-loop.

To Reproduce
The bug is general for any model that uses the .backtest method. For simplicity, I pick ARIMA.

import sys
import os
import yaml
sys.path.insert(1, '..')
os.chdir('..')

import seaborn as sns
sns.set_style('whitegrid')
import matplotlib.pyplot as plt
import statsmodels.api as sm
import sklearn
import optuna

from darts import models
from darts import metrics
from darts import TimeSeries
from darts.dataprocessing.transformers import Scaler
from darts.datasets import AirPassengersDataset, MonthlyMilkDataset

# load datasets
air_passengers = AirPassengersDataset().load()
milk = MonthlyMilkDataset().load()

# create sequence of series
series = [air_passengers, milk]

# define model
arima = models.ARIMA(p=1, d=1, q=1, seasonal_order=(0, 0, 0, 0))

# backtest
error = arima.backtest(series,
                                        train_length=30,
                                        forecast_horizon=2,
                                        stride=1,
                                        retrain=True,
                                        last_points_only=False,
                                        verbose=False)

Expected behavior
The .backtest should produce the errors.

System (please complete the following information):

  • Python version: 3.10.9
  • darts version: 0.23.1

Additional context
This is simple to fix by replacing series with target_ts in the forecasting_model.py file.

@mrsergazinov mrsergazinov added bug Something isn't working triage Issue waiting for triaging labels Jan 25, 2023
@hrzn hrzn removed triage Issue waiting for triaging labels Jan 26, 2023
@hrzn
Copy link
Contributor

hrzn commented Jan 26, 2023

Thanks for reporting @mrsergazinov
That's indeed a bug, and should be fixed by #1517

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants