Attribution#

class scikitplot.feature_selection.Attribution(by_input, unattributed, how)[source]#

Values of transformed features summed back onto raw input features.

Attributes:
by_inputpandas.Series or pandas.DataFrame

For 1-D values, a Series indexed by input name; for 2-D values (n_samples x n_outputs, such as SHAP values), a DataFrame with one column per input. Only exactly attributable outputs contribute.

unattributedpandas.DataFrame

One row per output that could not be attributed to a single input, with output, origins (tuple of input names), reason (multiple_origins, mixed_lineage, unknown_lineage, no_origin) and, for 1-D values, value.

howstr

Aggregation used.

Parameters:
  • by_input (Any)

  • unattributed (pd.DataFrame)

  • how (str)

Notes

User note. Summing is exact for additive quantities: one-hot SHAP values, gain-based importances, coefficients’ absolute contributions. It is a convention, not a theorem, for permutation importances of correlated dummies; prefer permuting the raw column for those.