shap/kernel-explainer-l1-reg-auto
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| shap | warning | none, edit by hand | All versions |
l1_reg="auto" in KernelExplainer.shap_values() emits a DeprecationWarning in SHAP 0.54. Choose an explicit regularization strategy such as "num_features(10)", "aic", or "bic".
sv = kernel_explainer.shap_values(X_val, l1_reg="auto")sv = kernel_explainer.shap_values(X_val, l1_reg="num_features(10)")What the rule reports
Section titled “What the rule reports”Calls to .shap_values(...) passing l1_reg="auto".
How to fix it
Section titled “How to fix it”Pass "num_features(k)", "aic", "bic", or a float L1 penalty.
Diagnostic message
Section titled “Diagnostic message”l1_reg='auto' in KernelExplainer.shap_values() is deprecated and emits a DeprecationWarning. Pass 'num_features(10)', 'aic', 'bic', or a float regularization value instead.See all rules in the shap pack.