interpret icon indicating copy to clipboard operation
interpret copied to clipboard

How can I retrieve a confidence score from the global explanation graph of each feature for each feature value?

Open aman63 opened this issue 4 years ago • 2 comments

aman63 avatar May 16 '21 16:05 aman63

Moved this comment to a new issue: #235

bverhoeff avatar May 16 '21 20:05 bverhoeff

Hi @aman63,

Good question! You can access these through the .data() method on any global explanation. For example:

ebm_global = ebm.explain_global()
graph_data = ebm_global.data(0)  # Gets graph related info for 0th feature -- swap input for different features

This returns a dictionary, with different graph-related information stored as parallel arrays. The upper and lower bounds can be accessed with:

# Extract upper and lower bound info
graph_data['upper_bounds']
graph_data['lower_bounds']

and the main x and y axis values are:

graph_data['names']  # x-axis values -- numbers for numeric features, strings for categorical
graph_data['scores']  # learned EBM effect

Outside of the global explanation object, the confidence scores are also stored on the ebm in the term_standard_deviations_ property. The confidence bounds are symmetric, so this property only contains the value we add and subtract from the main effect graph to get the full interval for each bin.

Hope this helps, and let us know if you have further questions! -InterpretML Team

interpret-ml avatar May 19 '21 15:05 interpret-ml