Mean absolute scaled error for forecasting evaluation
See original GitHub issueWhile 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:
- Created 3 years ago
- Reactions:14
- Comments:9 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think it is okay to close this one. For those who are interested, this metric is defined in
sktime
:https://github.com/alan-turing-institute/sktime/blob/ee7a06843a44f4aaec7582d847e36073a9ab0566/sktime/performance_metrics/forecasting/_functions.py#L16
Direct link to SKTime documentation: https://www.sktime.org/en/stable/api_reference/auto_generated/sktime.performance_metrics.forecasting.MeanAbsoluteScaledError.html