shap.Explanation

class shap.Explanation(values, base_values=None, data=None, display_data=None, instance_names=None, feature_names=None, output_names=None, output_indexes=None, lower_bounds=None, upper_bounds=None, main_effects=None, hierarchical_values=None, clustering=None)

A slicable set of parallel arrays representing a SHAP explanation.

__init__(values, base_values=None, data=None, display_data=None, instance_names=None, feature_names=None, output_names=None, output_indexes=None, lower_bounds=None, upper_bounds=None, main_effects=None, hierarchical_values=None, clustering=None)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(values[, base_values, data, …])

Initialize self.

cohorts(cohorts)

Split this explanation into several cohorts.

percentile(q[, axis])

Attributes

abs

argsort

base_values

clustering

data

display_data

feature_names

flip

hclust

hierarchical_values

identity

instance_names

lower_bounds

main_effects

max

mean

min

output_indexes

output_names

sample

shape

sum

upper_bounds

values

cohorts(cohorts)

Split this explanation into several cohorts.

Parameters
cohortsint or array

If this is an integer then we auto build that many cohorts using a decision tree. If this is an array then we treat that as an array of cohort names/ids for each instance.