Repository navigation
docs: add mkdocs-material site with API reference and GitHub Pages deployment (#16) - #24
Conversation
…ployment (adaumsilva#16) - Setup mkdocs.yml with mkdocs-material and mkdocstrings[python] - Add pages: Getting started, Methods (coalition, surrogate, permutation, consensus), Extending, API reference, and Changelog - Configure GitHub Actions workflow deploying to GitHub Pages on push to main and strict docs build check in CI - Streamline README to focus on quick start and link to documentation site
|
The work did take a lot of time and helps from various sources and I may be wrong in things that I have done but do review them and comment back if there is any error. |
|
Hello, is it accepted or changes needed ? |
Updated permissions for contents and improved job steps for documentation build and deployment.
|
Thanks for adding the documentation site @prannoydidymus ! The structure and API reference are useful, but several examples and formulas need corrections before merging:
Please also resolve the README conflict with current The documentation builds pass, but these issues affect users following the guides, so I’m requesting changes. |
adaumsilva
left a comment
There was a problem hiding this comment.
Thanks for adding the documentation site! The structure and API reference are useful, but several examples and formulas need corrections before merging:
-
Fix the custom explainer example (
docs/extending.md, lines 32–51). Running it raisesAttributeErrorbecauseModelAdapter.predict_scalar()does not exist. Useself._predict_scalar(..., target)[0]to obtain each scalar prediction. Also replaceinstance=xwithx=xin_make_explanation()and passstep_size=epsdirectly instead of nesting it insidemetadata. -
Correct the Borda formula (
docs/methods/consensus.md, lines 30–35). The implementation uses(n_features - rank + 1) / n_features, averages these scores using normalized method weights, and applies the mean direction. The documented formula instead gives larger scores to less important features and introduces a normalization absent from the implementation. -
Correct the surrogate description (
docs/methods/surrogate.md, lines 13–38). Default perturbations are centered on the background mean; centering on the instance requiressample_around_instance=True. The kernel isexp(-D² / (2 * kernel_width²)). Continuous-feature contributions use standardized values,coef_i * (x_i - mean_i) / std_i, with categorical features handled through indicator encoding. -
Fix permutation metrics and uncertainty terminology (
docs/methods/permutation.md, lines 24–39). Bothmetric="mse"andmetric="roc_auc"raiseValueError. Document the supported names, includingneg_mseandneg_mae; ROC AUC requires a custom callable. Also,importances_stdis the population standard deviation across repeats (ddof=0), not a standard error or sample standard deviation.
Please also resolve the README conflict with current main, preserving the notebook link introduced by #23, and add executable smoke checks for the documentation examples.
The documentation builds pass, but these issues affect users following the guides, so I’m requesting changes.
… smoke checks - Fix custom explainer example in docs/extending.md using _predict_scalar and x=x - Correct Borda formula and weighting in docs/methods/consensus.md - Correct surrogate perturbations, proximity kernel, and standardized feature contributions in docs/methods/surrogate.md - Correct permutation metrics, custom callable instructions, and population standard deviation in docs/methods/permutation.md - Add executable smoke checks for documentation examples in tests/test_docs_smoke.py
…/docs-mkdocs-site
|
Please review if the work done is enough @adaumsilva |
|
Thanks for contributing @prannoydidymus PR Merged! Good job! Remember to star the repo if you didn't yet. |
|
Thank you so much, @adaumsilva! It was a pleasure contributing to your repository. I really appreciate the opportunity and enjoyed working on it. |
What
Closes #16
Adds a documentation site built with
mkdocs-materialandmkdocstrings, documents mathematical formulations for each explainer, adds an extending guide and API reference, configures GitHub Pages deployment, and streamlines the README to focus on the quick start.Why
The README was growing long. A dedicated documentation site separates the quick start from deep method explanations, mathematical details, and the full API reference generated from docstrings.
How
mkdocs.yml: Configuredmaterialtheme with MathJax math rendering, code copy buttons, search, andmkdocstrings[python]handler withnumpydocstring style.docs/index.md&docs/getting-started.md: Overview and step-by-step tutorial for local and global explanations.docs/methods/: Explainer pages with concise mathematics forcoalition(Shapley cooperative games, axioms, sampling),surrogate(local linear model, proximity kernel, weighted Ridge), andpermutation(loss drops, smooth log-loss, held-out data).docs/methods/consensus.md: Scale normalization, weighted mean / Borda rank aggregation, and Spearman rank agreement (docs/extending.md: Guide on subclassingBaseExplainerand packaging custom explainers via entry points.docs/api/: API reference pages forauto,explainers,explanation,model, andregistry.docs/changelog.md: Embedded changelog..github/workflows/docs.yml: Builds and deploys documentation to GitHub Pages on push tomain..github/workflows/ci.yml: Added strict docs build validation (mkdocs build --strict).README.md: Streamlined to keep the quick start and added direct navigation links to the docs site.pyproject.toml: Addeddocsoptional dependencies.CHANGELOG.md: Logged release notes under[Unreleased].Checklist
pytestpasses (91 passed)ruff checkandruff format --checkpassself.rng(reproducible withrandom_state)