Hi everyone! I've been reading the <documentation...
# mlforecast
i
Hi everyone! I've been reading the documentation on SHAP values, and something caught my attention: when I transform my target variable, the output of the waterfall plot becomes harder to interpret. How can I properly adjust the output while still keeping the target transformation for the model?
a
You need to inverse transform manually the shap values per series You can find the stddev and mean per series here: # Create dictionary for stdscaler scaler_dict = { unique_id: [ scaler_stats[0], # Mean mu scaler_stats[1], # Std deviation sigma ] for unique_id, scaler_stats in zip( fcst.ts.uids, fcst.ts.target_transforms[0].scaler_.stats_, ) } Then the base value should be rescaled with inverse formula (X*sigma + mu) The shap values shoudl be rescaled only with X*sigma
It would be awesome to have a method included in nixtla library by the way
Oh also, this works only with linear scaling (e.g. for logscaling or boxcox should not work)
i
It's clear. Thanks a lot 🙂