docs: correct docstring/implementation drift across multivariate, regression, experiments, and monitoring - #495
Merged
Merged
Conversation
Add caveat noting that a numeric alpha is only honored for the fractional-cube CCD path; cube='full' silently coerces it to 'orthogonal'. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
Propagate the same numeric-alpha caveat: a numeric alpha is only honored for cube='fractional'; cube='full' silently coerces it to 'orthogonal'. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
PCA.select_n_components: document return_consensus in Parameters and add the four extra Returns keys it exposes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
PLS.select_n_components: complete the truncated selection_mode Returns sentence (mode is None when selection_distribution is None). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
robust_regression: add t_value to always-present keys and describe the degenerate early-return dict contents. multiple_linear_regression: align Returns with OLS.to_dict() output. Add R2_regression_based, R2_residual_based, k, conf_interval_intercept; document the degenerate-path shapes for coefficients and conf_intervals. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
MBPLS: expand the Attributes section to list every fitted attribute actually set in fit() (n_samples_, n_targets_, n_features_in_, feature_names_in_, preproc_, y_preproc_, super_hotellings_t2_, super_vip_, block_spe_, block_hotellings_t2_, block_vip_, and the r2_x_/r2_y_ family). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
MBPCA: expand the Attributes section to list every fitted attribute individually with its shape/type, replacing the '(as MBPLS)' shorthand. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
TPLS: expand the Attributes section from two fields to the full set of attributes set in fit() (score/loading families, spe/spe_limit nested dicts, mask arrays, name maps, etc.) and add a note that TPLS does not follow the sklearn trailing-underscore convention for its fitted attributes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
OPLS.spe_: clarify that the returned DataFrame's per-column values are broadcasts of the final-component SPE, not a per-component progression like the PCA/PLS spe_. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
spe_calculation: document the SEC-21/#270 fallback: when variance or centre of the squared SPE is at or below epsqrt, the Jackson-Mudholkar chi-square approximation degenerates and the limit falls back to sqrt(center_spe). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
t_value / t_value_cdf: replace undefined 'v' in the doctest examples
with 'v=10' and correct the -inf / +inf renderings (scipy returns
-inf / +inf at p in {0, 1}, not NaN, and Python prints them lowercase).
ttest_paired already documents that its 'Standard deviation' key holds
the standard error of the mean difference, so no change is needed
there.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
find_elbow_point: add an explicit Returns section that covers both the -1 (all-missing) and NaN (no consensus intersection) return paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
analyze_experiment: enumerate every key that the always-present model_summary dict actually carries (formula, n_obs, n_terms, model_rank, rank_deficient, df_model, df_residual, mse_residual), in addition to the R^2 and adequate-precision entries that were already documented. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
ControlChart.__init__: mark 'cusum' as an unimplemented future variant; only 'hw' and 'xbar.no.subgroup' are dispatched by calculate_limits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
Docs-only PATCH bump. Sync CITATION.cff to the same version and today's date; add a Documentation entry under [Unreleased] in CHANGELOG.md summarising the 17 docstring corrections in this PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132CNPVroNNG679mikPzqwc
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
Docstring-only corrections across several modules where the NumPy-style docstring drifted from the actual runtime behavior. No runtime behavior is changed; only the documented behavior is aligned with the code.
Grouped by module:
Experiments
experiments/designs_response_surface.py::dispatch_ccd- note that a numericalphais only honored for the fractional-cube path;cube="full"silently coerces it to"orthogonal".experiments/designs.py::generate_design- same caveat propagated at the wrapper level.experiments/analysis.py::analyze_experiment- add the missingmodel_summarykeys (formula,n_obs,n_terms,model_rank,rank_deficient,df_model,df_residual,mse_residual) to the Returns section.Multivariate
multivariate/_pca.py::PCA.select_n_components- documentreturn_consensusin Parameters and the extra Returns keys (minka_n_components,parallel_analysis_n_components,consensus,consensus_counts).multivariate/_pls.py::PLS.select_n_components- complete the truncatedselection_modeReturns sentence.multivariate/_mbpls.py::MBPLS- flesh out the Attributes section with the fitted attributes actually set infit().multivariate/_mbpca.py::MBPCA- same, replacing the "as MBPLS" shorthand with the concrete list.multivariate/_tpls.py::TPLS- list undocumented fitted attributes and add a note that TPLS attributes deliberately do not follow the sklearn trailing-underscore convention.multivariate/_opls.py::OPLS.spe_- clarify that per-column values are broadcasts of the final-component SPE, not a per-component progression.multivariate/_limits.py::spe_calculation- note the SEC-21/[SEC-21] NaN-poisoning in single-block PCA / PLS / TPLS #270 fallback when variance/center is at or below epsqrt.Regression
regression/_robust_regression.py::robust_regression- addt_valueto the always-present keys and note the initialization values on the degenerate early-return path.regression/_robust_regression.py::multiple_linear_regression- align the Returns list with the actualOLS.to_dict()output (degenerate-path shapes, plusR2_regression_based,R2_residual_based,k,conf_interval_intercept).Univariate
univariate/metrics.py::t_value- replace undefinedvin examples with a concrete value and correct thep in {0, 1}behavior description.univariate/metrics.py::t_value_cdf- same fix.univariate/metrics.py::ttest_paired- clarify that the value under the"Standard deviation"key is actually the standard error of the mean difference (key name kept as-is to avoid a behavior change).Bivariate
bivariate/_elbow_peak.py::find_elbow_point- document the secondary NaN return path.Monitoring
monitoring/control_charts.py::ControlChart.__init__- align the documentedvariantvalues with the branches that actually exist.Test plan
ruff check .passes.ruff format --check .passes.Checklist
pyproject.toml(PATCH for docs)ruff check .passesCHANGELOG.mdupdated🤖 Generated with Claude Code
Generated by Claude Code