Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook 10: Section 309 MASE #585

Open
patrickofdenver opened this issue Sep 18, 2023 · 0 comments
Open

Notebook 10: Section 309 MASE #585

patrickofdenver opened this issue Sep 18, 2023 · 0 comments

Comments

@patrickofdenver
Copy link

Hi friends,

When using the 'mean_absolute_scaled_error' function, I was getting an error about being unable to subtract lists. I had to modify it to turn the y_true and naive_forecast into np.array in order for the error to go away and get the same result as the video. Unsure if it'll throw an error down the road, but I changed the function as follows:

def mean_absolute_scaled_error(y_true, y_pred):
"""
Implement MASE (assuming no seasonality of data).
"""
mae = tf.reduce_mean(tf.abs(np.array(y_true) - np.array(y_pred)))

Find MAE of naive forecast (no seasonality)

mae_naive_no_season = tf.reduce_mean(tf.abs(np.array(y_true[1:]) - np.array(y_true[:-1]))) # our seasonality is 1 day (hence the shifting of 1 day)

return mae / mae_naive_no_season

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant