Skip to content

utilsforecast/mase-without-train-df

Rule mase-without-train-df
Pack UtilsForecast
Severity error
Fix none, edit by hand
Library versions every version

MASE divides forecast errors by a seasonal naive error measured on the training series. Pass that history to evaluate.

scores = evaluate(forecasts, metrics=[partial(mase, seasonality=7)])
scores = evaluate(forecasts, metrics=[partial(mase, seasonality=7)], train_df=train)

The rule looks for an inline metrics list or tuple containing the imported UtilsForecast mase, either directly or as the first argument to functools.partial. It reports the call when train_df is missing or explicitly None by keyword. It leaves calls with unpacked arguments or a positional training frame alone.

UtilsForecast 0.2.17 raised ValueError asking for train_df. The corrected call returned one MASE score for each of three series. See the evaluation API.

Pass the observations used to train the forecast and bind the seasonal period when you construct the metric. xpd has no automatic fix because it cannot identify the correct history.

xpd prints this message with the issue. A name that starts with $ stands for code from your file.

UtilsForecast needs training history to compute the seasonal scale for MASE. Pass the pre-forecast observations as train_df and bind the metric's seasonality if needed.

Browse the other rules of the UtilsForecast pack.