Open
Description
Issue Description
I first got an error stating TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''. Then I changed it to numeric values and now I get this error. How can I resolve this?
Minimal Reproducible Example
X = df_encoded.drop(columns=["y", "ds", "unique_id"])
# Extract the best-performing model from AutoMLForecast (e.g., Ridge, LGBM, XGB)
best_model = auto_mlf.models_['lgb'] # Change this if needed
# Sample a subset of X for SHAP computation (improves speed)
X_sample = shap.utils.sample(X, 100)
# Create SHAP Explainer using AutoMLForecast model's predict function
explainer = shap.Explainer(lambda x: best_model.predict(pd.DataFrame(x, columns=X.columns)), X_sample)
# Compute SHAP values
shap_values = explainer(X)
# Plot feature importance
shap.summary_plot(shap_values, X)
Traceback
Expected Behavior
No response
Bug report checklist
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest release of shap.
- I have confirmed this bug exists on the master branch of shap.
- I'd be interested in making a PR to fix this bug
Installed Versions
0.47.0