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, error_std=None, main_effects=None, hierarchical_values=None, clustering=None, compute_time=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, error_std=None, main_effects=None, hierarchical_values=None, clustering=None, compute_time=None)

Methods

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

cohorts(cohorts)

Split this explanation into several cohorts.

percentile(q[, axis])

Attributes

abs

argsort

base_values

Pass-through from the underlying slicer object.

clustering

Pass-through from the underlying slicer object.

data

Pass-through from the underlying slicer object.

display_data

Pass-through from the underlying slicer object.

error_std

Pass-through from the underlying slicer object.

feature_names

Pass-through from the underlying slicer object.

flip

hclust

hierarchical_values

Pass-through from the underlying slicer object.

identity

instance_names

Pass-through from the underlying slicer object.

lower_bounds

Pass-through from the underlying slicer object.

main_effects

Pass-through from the underlying slicer object.

max

mean

min

output_indexes

Pass-through from the underlying slicer object.

output_names

Pass-through from the underlying slicer object.

sample

shape

Compute the shape over potentially complex data nesting.

sum

upper_bounds

Pass-through from the underlying slicer object.

values

Pass-through from the underlying slicer object.

property base_values

Pass-through from the underlying slicer object.

property clustering

Pass-through from the underlying slicer object.

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.

property data

Pass-through from the underlying slicer object.

property display_data

Pass-through from the underlying slicer object.

property error_std

Pass-through from the underlying slicer object.

property feature_names

Pass-through from the underlying slicer object.

property hierarchical_values

Pass-through from the underlying slicer object.

property instance_names

Pass-through from the underlying slicer object.

property lower_bounds

Pass-through from the underlying slicer object.

property main_effects

Pass-through from the underlying slicer object.

property output_indexes

Pass-through from the underlying slicer object.

property output_names

Pass-through from the underlying slicer object.

property shape

Compute the shape over potentially complex data nesting.

property upper_bounds

Pass-through from the underlying slicer object.

property values

Pass-through from the underlying slicer object.