Add SHAP explanations to API and Streamlit#6
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f414b02ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| X = preprocessor.transform(input_df) | ||
| feature_names = preprocessor.get_feature_names_out() | ||
|
|
||
| import shap |
There was a problem hiding this comment.
Declare SHAP dependency for package installs
This new import shap introduces a runtime dependency that is only added to requirements.txt, but pyproject.toml still omits shap from [project].dependencies. If users install the app via pip install . (PEP 621), the import will raise ModuleNotFoundError and /explain/Streamlit will fail at runtime; consider adding shap to pyproject.toml dependencies (or an optional extra) so package installs remain functional.
Useful? React with 👍 / 👎.
Adds SHAP explanations to FastAPI (/explain)
Adds SHAP contributions table to Streamlit
Adds shap to requirements.txt