Closed mrsergazinov closed 1 year ago
Describe the bug Type mismatch in the .backtest method due to a typo in the for-loop.
.backtest
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):
Additional context This is simple to fix by replacing series with target_ts in the forecasting_model.py file.
series
target_ts
forecasting_model.py
Thanks for reporting @mrsergazinov That's indeed a bug, and should be fixed by https://github.com/unit8co/darts/pull/1517
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.Expected behavior The
.backtest
should produce the errors.System (please complete the following information):
Additional context This is simple to fix by replacing
series
withtarget_ts
in theforecasting_model.py
file.