mase#

tslearn.metrics.performance.mase(y_true, y_pred, train_data, seasonal_period=1, ts_weights=None, timestamps_weights=None, multioutput='uniform_average')[source]#

Mean absolute scaled error (MASE)

MASE is a measure of the prediction accuracy for forecasting and regression tasks that computes the scaled average of the deviations between ground truth and predicted values.

The scaling factor is computed as the MAE of the naive m-seasonal forecast on the in-sample dataset.

Parameters:
y_true: array like, shape (n_ts, sz, d)

Target dataset of ground_truth values

y_pred: array like, shape (n_ts, sz, d)

Estimated dataset of predicted values

train_data: array like

the in-sample dataset, used to compute the scaling factor

seasonal_period: int (default: 1)

seasonal period used to compute the scaling factor

ts_weights: array like, shape (n_ts,) or None (default: None)

Weights to apply to the time-series in the datasets if non-uniform. Use none for uniform weights.

timestamps_weights: array like, shape (sz,) or None (default: None)

Weights to apply to the timestamps of each-time series if non-uniform. Use none for uniform weights.

multioutput: {‘uniform_average’, ‘raw_values’} or array-like, shape (d,) (default: ‘uniform_average’)

for multivariate timeseries, defines the aggregation of per feature results, if any.

‘raw_values’:

no aggregation, result is per feature

‘uniform_average’:

errors of all features are averaged with uniform weights

array-like:

errors of all features are averaged using the given weights

Returns:
float or array-like, shape (d,)

If multioutput is ‘raw_values’, then mean squared error is returned for each feature. Otherwise, the average of each feature is returned.