interpret icon indicating copy to clipboard operation
interpret copied to clipboard

Lookup Table for single feature and feature interaction terms

Open sauvikd opened this issue 1 year ago • 3 comments

Screenshot 2024-04-19 035202

How can I extract a lookup table for the red-line (score values for the each of the features) and similarly the data for the heatmap.

I had tried downloading the ebm_global.data(1)['scores'], but those are values for each of the bins, from what I understand. Even if I'm able to extract the bin boundary values, I will be able to connect them with the feature values.

sauvikd avatar Apr 19 '24 08:04 sauvikd

Hi @sauvikd --

One of the very nice things about EBMs, and GAMs in general, is that the scores are used when calculating the predictions AND what are shown on the graphs. EBMs have no hidden information.

For graphing though, you also need the "bins" attribute, which for continuous features are the locations on the X-axis where the bin transitions occur.

There's some code which creates graphs here: https://github.com/interpretml/interpret/issues/325

And you might also find our documentation on EBM internals useful: https://interpret.ml/docs/ebm-internals-regression.html

paulbkoch avatar Apr 19 '24 21:04 paulbkoch

Thank you so much @paulbkoch for answering my query. It helped me solve my problem.

There's a 2nd part of my query if you can answer my query. Although I can retrieve the individual feature importance plots showing scores using the following piece of code.

for feature_idx, feature in enumerate(best_ebm_model.term_names_):
        iplot(ebm_global_explainer.visualize(feature_idx))

How can I separately plot the - EBM Summary Global Importance bar plot, like the one below? image

sauvikd avatar May 23 '24 06:05 sauvikd

Hi @sauvikd --

We usually recommend the show function: show(ebm_global_explainer)

But, if you want to use iplot, try this: iplot(ebm_global_explainer.visualize(None))

paulbkoch avatar May 23 '24 18:05 paulbkoch

Thanks @paulbkoch, it worked for me. I was looking to save these images without manually taking a screenshot.

sauvikd avatar May 29 '24 20:05 sauvikd

Glad to hear this worked @sauvikd. Closing this issue then.

paulbkoch avatar Jun 16 '24 00:06 paulbkoch