When using backtest and historical_forecast in darts I expect the same error. However, when doing a test, I get different MAPE values for the same input variables. Can somebody explain how this can happen? How can I make the two methods comparable?
Example:
import pandas as pd
from darts import TimeSeries
from darts.models import NaiveDrift
from darts.metrics import mape
df = pd.read_csv('AirPassengers.csv')
series = TimeSeries.from_dataframe(df, 'Month', '#Passengers')
print("Backtest MAPE: ", NaiveDrift().backtest(series,
start=12,
forecast_horizon=6,
metric=mape))
historical_forecast = NaiveDrift().historical_forecasts(series,
start=12,
forecast_horizon=6,
verbose=False)
print("Historical Forecast MAPE: ", mape(historical_forecast, series))
Output:
Backtest MAPE: 16.821355933599133
Historical Forecast MAPE: 21.090231183002143
Links
Link to the documentation:https://unit8co.github.io/darts/generated_api/darts.models.forecasting.baselines.html
Link to the dataset: https://www.kaggle.com/datasets/rakannimer/air-passengers