facet.inspection.ShapPlotData#

class facet.inspection.ShapPlotData(shap_values, sample)[source]#

Data for use in SHAP plots provided by the shap package.

Parameters
  • shap_values (Union[ndarray[Any, dtype[float64]], List[ndarray[Any, dtype[float64]]]]) – the shap values for all observations and outputs

  • sample (Sample) – (sub)sample of all observations for which SHAP values are available; aligned with param shap_values

Attribute summary

features

Matrix of feature values (number of observations by number of features).

shap_values

Matrix of SHAP values (number of observations by number of features) or list of shap value matrices for multi-output models.

target

Series of target values (number of observations) or matrix of target values for multi-output models (number of observations by number of outputs).

Definitions

property features: pandas.DataFrame#

Matrix of feature values (number of observations by number of features).

Return type

DataFrame

property shap_values: Union[numpy.ndarray[Any, numpy.dtype[numpy.float64]], List[numpy.ndarray[Any, numpy.dtype[numpy.float64]]]]#

Matrix of SHAP values (number of observations by number of features) or list of shap value matrices for multi-output models.

Return type

Union[ndarray[Any, dtype[float64]], List[ndarray[Any, dtype[float64]]]]

property target: Union[pandas.Series, pandas.DataFrame]#

Series of target values (number of observations) or matrix of target values for multi-output models (number of observations by number of outputs).

Return type

Union[Series, DataFrame]