question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mean absolute scaled error for forecasting evaluation

See original GitHub issue

While playing with some time-series dataset to make some forecasting, I came across the following paper:

R.J. Hyndman, A.B. Koehler, Another look at measures of forecast accuracy, International Journal of Forecasting, 22 (2006), pp. 679-688

They introduce the mean absolute scaled error that scale forecasting error by the mean absolute error of in-sample data. The intuition that I get is that this measure will tell you, on average how better or worse your model is at predicting compared to just predicting the previous sample.

A basic implementation would be something like:

from sklearn.metrics import mean_absolute_error

def mean_absolute_scaled_error(y_true, y_pred, y_train):
    e_t = y_true - y_pred
    scale = mean_absolute_error(y_train[1:], y_train[:-1])
    return np.mean(np.abs(e_t / scale))

This metric, does not follow the usual API of the other metrics. Would it still be an interesting addition to scikit-learn?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:14
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Mean Absolute Scaled Error (MASE) in Forecasting - Medium
In time series forecasting, Mean Absolute Scaled Error (MASE) is a measure for determining the effectiveness of forecasts generated through ...
Read more >
Interpretation of mean absolute scaled error (MASE)
Mean absolute scaled error (MASE) is a measure of forecast accuracy proposed by Koehler ...
Read more >
MASE - Mean Absolute Scaled Error - Help center - NumXL
Calculates the mean absolute scaled error (MASE) between the forecast and the eventual outcomes. Syntax. MASE(X, F, M). X: is the eventual outcome...
Read more >
ANOTHER LOOK AT FORECAST-ACCURACY METRICS ...
He also introduces a new metric—the mean absolute scaled error. (MASE)—which is more appropriate for intermittent-demand data. More generally, he believes that ...
Read more >
MeanAbsoluteScaledError — sktime documentation
Mean absolute scaled error (MASE). MASE output is non-negative floating point. The best value is 0.0. Like other scaled performance metrics, this scale-free ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found