I’m stuck on this for a while.
Please could you help in calculating the WMAE.
From Kaggle Walmart COmpetition Page:
def exp_wmae(y_pred, targ): if holiday_week: return (targ - y_pred)*5 else return (targ - y_pred)
I want the WMAE error to be displayed each time I call the fit function.
I have a column holiday_week which checks for holiday, but wondering how do I access this column holiday_week while the model is training?
Just having trouble understanding this.
I looked at Rossmann code. For Rossman it was RMSE and it was passed via metrics.
def inv_y(a): return np.exp(a) def exp_rmspe(y_pred, targ): targ = inv_y(targ) pct_var = (targ - inv_y(y_pred))/targ return math.sqrt((pct_var**2).mean()) max_log_y = np.max(yl) y_range = (0, max_log_y*1.2)
m.fit(lr, 3, metrics=[exp_rmspe], cycle_len=1)
There was no weighted mean in exp_rmspe. But here we need to check if each prediction is a holiday_week and accordingly add a weight to the formula.
My question is how do I check/access this holiday_week inside each prediction? Not sure if I am doing this correctly, as I am not able to understand how to do this at all. Also, not sure what y_range is doing in the Rossmann code.
Thanks for your help