-
Beta Was this translation helpful? Give feedback.
Answered by
mrdbourke
Sep 29, 2021
Replies: 1 comment
-
Heya, The MASE (mean absolute scaled error) formula used in the notebook 10: https://github.com/mrdbourke/tensorflow-deep-learning/blob/main/10_time_series_forecasting_in_tensorflow.ipynb # MASE implemented courtesy of sktime - https://github.com/alan-turing-institute/sktime/blob/ee7a06843a44f4aaec7582d847e36073a9ab0566/sktime/performance_metrics/forecasting/_functions.py#L16
def mean_absolute_scaled_error(y_true, y_pred):
"""
Implement MASE (assuming no seasonality of data).
"""
mae = tf.reduce_mean(tf.abs(y_true - y_pred))
# Find MAE of naive forecast (no seasonality)
mae_naive_no_season = tf.reduce_mean(tf.abs(y_true[1:] - y_true[:-1])) # our seasonality is 1 day (hence the shifting of 1 day)
return mae / mae_naive_no_season It takes the mean before the end. Slightly different to the formula you're looking at but I believe they achieve the same result. The notebook 10 implementation is based on Sktime's implementation: https://github.com/alan-turing-institute/sktime/blob/ee7a06843a44f4aaec7582d847e36073a9ab0566/sktime/performance_metrics/forecasting/_functions.py#L16 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lukbast
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Heya,
The MASE (mean absolute scaled error) formula used in the notebook 10: https://github.com/mrdbourke/tensorflow-deep-learning/blob/main/10_time_series_forecasting_in_tensorflow.ipynb