Skip to content

Notebook 10: Section 309 MASE #585

@patrickofdenver

Description

@patrickofdenver

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions