Compute the day-ahead MASE scaling factor for each target period.
For every entry in periods the factor is the mean absolute seasonality-step difference of actual over all observations strictly before that period’s start: \(\text{mean}\, |y_t - y_{t-s}|\) for \(t < \text{period}\). Dividing a period’s MAE by its factor yields the MASE of the manuscript-style expanding-history definition — for a single (y_true, y_pred, y_train) triple this equals the denominator spotforecast2_safe.forecaster.metrics.mean_absolute_scaled_error computes internally.