interpretml/gam-changer

AttributeError: 'ExplainableBoostingClassifier' object has no attribute 'histogram_counts_'

austin-rubin opened this issue · 6 comments

gc.visualize(ebm, X_sample, y_sample) results in an attribute error as shown in the following image:

gam-changer attribute error

This was ran on the provided Binder and Google Colab demo notebooks

Yeah its a bug but thankfully its a quick hack to make it work.

From something I was working on today :

`
#make a ebm
ebm = ExplainableBoostingRegressor(random_state=seed, n_jobs=-1, objective = "poisson_deviance",
interactions=5)

#run this
ebm.histogram_counts_ = ebm.bagged_scores_

#gamchanger should now work
gc.visualize(ebm, X_sample, y_sample)
`

#run this
ebm.histogram_counts_ = ebm.bagged_scores_

#gamchanger should now work
gc.visualize(ebm, X_sample, y_sample)

Thanks for the workaround, @serband !

I am not sure if it's only on my device, but have you also noticed that the density plot doesn't render?

GAMCHANGER on my device:
gam_changer

GAMCHANGER based on the repo's README:
68747470733a2f2f692e696d6775722e636f6d2f654b7a4b4a666c2e706e67

Thank you so much @austin-rubin and @serband!

ebm.histogram_counts_ = ebm.bagged_scores_ is a nice try, but it should be ebm.histogram_counts_ = ebm.histogram_weights. 😂 Interpret changed the name histogram_counts_ to histogram_weights_ (and also int → float) in interpretml/interpret@fe59c2f.

4b2194c should fix it. @austin-rubin you can try to update gamchanger to 0.1.13, and the visualization should show up correctly. Let me me know if it doesn't work.

@xiaohk I already updated to gamchanger 0.1.13. The visualization showed up correctly now on my end. Thanks!

Awesome!! 🎉

@austin-rubin apologies for giving you the wrong answer! @xiaohk Thank you for the quick fix!