Skip to content

shap/linear-explainer-deprecated-perturbation

Pack Severity Fix Versions
shap warning none, edit by hand All versions

feature_perturbation= on shap.LinearExplainer is deprecated and emits a FutureWarning in favor of passing an explicit masker (shap.maskers.Independent, shap.maskers.Impute, or shap.maskers.Partition).

explainer = shap.LinearExplainer(model, X_train, feature_perturbation="interventional")
explainer = shap.LinearExplainer(model, shap.maskers.Independent(X_train))

Calls to LinearExplainer(...) passing a non-None feature_perturbation=.

Wrap the background data in shap.maskers.Independent(X_train) for interventional SHAP or shap.maskers.Impute(X_train) for correlation-dependent SHAP.

feature_perturbation= on shap.LinearExplainer is deprecated and emits a FutureWarning. Pass shap.maskers.Independent(data) or shap.maskers.Impute(data) as the masker instead.

See all rules in the shap pack.