docs: explain formula-based reference levels for LFC shrinkage - #475
Open
rastagan-git wants to merge 1 commit into
Open
rastagan-git wants to merge 1 commit into
rastagan-git wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #475 +/- ##
==========================================
- Coverage 86.05% 85.97% -0.08%
==========================================
Files 15 15
Lines 1276 1276
==========================================
- Hits 1098 1097 -1
- Misses 178 179 +1
🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Reference Issue or PRs
Fixes #362. The underlying user example is in #361.
What does your PR implement? Be specific.
C(condition, contr.treatment(base='B')), fits a new dataset, prints its coefficient names, and shrinks the matching A-versus-B coefficient.lfc_shrink, and why numeric category labels needC().ref_levelargument's deprecation warning and documentation to the formula syntax.lfc_shrinkcoefficient contract and link to the tutorial. Remove the misleadingNonedefault from its docstring; no signature changes.ref_level.This does not change model fitting, shrinkage, statistical thresholds, or the handling of invalid coefficient names (which already raises
KeyError). The example creates and fits a new dataset rather than mutating a fitted design in place.Validation
Windows / CPython 3.12.11; formulaic 1.2.2, formulaic-contrasts 1.0.0:
pytest -q: 68 passed.prek run --files ...: all applicable hooks passed, including Ruff, AST checks, private-key detection, and mypy.python -m sphinx -M html docs docs/_build -W --keep-going: passed, including execution of the updated tutorial and its fit/shrink calls. The first build caught a short heading underline; it was corrected and the strict build rerun successfully.git diff --check: passed.The other two existing gallery examples also executed successfully during the first build; the final incremental build reused them. Used only the repository's synthetic example data, with no patient data or model service. The full Python 3.12/3.14/pre-release matrix was not run locally.
AI assistance was used for source analysis, editing, and tests. The commands above were actually executed; no independent human review or production-use experience is claimed.