docs(notebook): Improve notebook for v3#960
Merged
Merged
Conversation
Switch the Shapley Values cell from the legacy `interpretability.shap` adapter (classic shap library + PermutationExplainer) to the `shapiq` adapter via `get_tabpfn_imputation_explainer`. This produces equivalent bar/beeswarm/force plots through shapiq's native plotting and aligns the notebook with the currently recommended path in tabpfn-extensions. Also enable TabPFN's KV cache (`fit_mode="fit_with_cache"`), since the explainer triggers many `predict_proba` calls against the same training set — a clear speedup for SHAP-style workloads. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Colab wrote `metadata.widgets["application/vnd.jupyter.widget-state+json"]` without the required `state` wrapper, which trips GitHub's nbviewer: > the 'state' key is missing from 'metadata.widgets' The entries were leftover runtime widget state (e.g. tqdm bars) from cached outputs and carry no user-facing content — dropping the whole key restores rendering on GitHub. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates to
examples/notebooks/TabPFN_Demo_Local.ipynb:interpretability.shapadapter (classicshaplibrary +PermutationExplainer) toshapiqviaget_tabpfn_imputation_explainer. Same imputation paradigm, but using shapiq's nativebar_plot,beeswarm_plot, andplot_force. Surrounding markdown rewritten to explainshapiqand link toshap_example.pyin tabpfn-extensions for the classic-shappath.fit_mode="fit_with_cache") sinceshapiqissues manypredict_probacalls against the same training set. Markdown notes that this is local-only — for the client backend, drop the flag (slower).imputer="baseline"for a better speed/quality trade-off, keptn_estimators=8with a comment about throughput on stronger GPUs, and right-sized the demo split ton_samples_test=5,n_samples_train=200.cv=3tofeature_selection(...)to make the example reproducible without depending on the library's default CV setting.raise ValueError(...)that interrupted the run after install; replaced with a clearer markdown note telling the reader to restart the runtime before continuing.!pip install→!uv pip installfor consistency with the rest of the notebook.Test plan
cv=3.uv pipand confirm bothtabpfnandeconmlare picked up.🤖 Generated with Claude Code