Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ those changes.

## [Unreleased]

## [1.62.3] - 2026-07-31

### Fixed

- Docstrings: `PCA.select_n_components` now documents the
`return_consensus` parameter (previously present in the signature but
missing from the Parameters section) and the four extra Bunch keys it
attaches (`minka_n_components`, `parallel_analysis_n_components`,
`consensus`, `consensus_counts`).
- Docstring: `PLS.select_n_components` `selection_mode` bullet in the
Returns section had a truncated sentence ("or `None` when
`selection_distribution` is."); completed to "... is `None`.".

## [1.62.2] - 2026-07-29

### Changed
Expand Down Expand Up @@ -2787,7 +2800,8 @@ this entry records them together.
- Reworked the README with a sharper value proposition and a
"Why not scikit-learn?" comparison table.

[Unreleased]: https://github.com/kgdunn/process-improve/compare/v1.62.2...HEAD
[Unreleased]: https://github.com/kgdunn/process-improve/compare/v1.62.3...HEAD
[1.62.3]: https://github.com/kgdunn/process-improve/compare/v1.62.2...v1.62.3
[1.62.2]: https://github.com/kgdunn/process-improve/compare/v1.62.1...v1.62.2
[1.62.1]: https://github.com/kgdunn/process-improve/compare/v1.62.0...v1.62.1
[1.62.0]: https://github.com/kgdunn/process-improve/compare/v1.61.0...v1.62.0
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ authors:
repository-code: "https://github.com/kgdunn/process-improve"
url: "https://kgdunn.github.io/process-improve/"
license: MIT
version: 1.62.2
date-released: "2026-07-29"
version: 1.62.3
date-released: "2026-07-31"
keywords:
- chemometrics
- multivariate analysis
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "process-improve"
version = "1.62.2"
version = "1.62.3"
description = 'Designed Experiments; Latent Variables (PCA, PLS, multivariate methods with missing data); Process Monitoring; Batch data analysis.'
readme = "README.md"
license = "MIT"
Expand Down
20 changes: 20 additions & 0 deletions src/process_improve/multivariate/_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,14 @@ def select_n_components( # noqa: PLR0913, PLR0915, C901
emits a :class:`DeprecationWarning`; the value is ignored. Use
``selection_rule="q2_increment"`` (and tune ``min_q2_increase``)
for a comparable parsimony preference.
return_consensus : bool, default False
When ``True``, also run :meth:`minka_mle` and
:meth:`parallel_analysis` on ``X`` and attach their
recommendations to the returned Bunch alongside the ekf choice
(see the ``minka_n_components`` /
``parallel_analysis_n_components`` / ``consensus`` /
``consensus_counts`` fields below). Off by default because the
two extra estimates require their own eigendecomposition.
**pca_kwargs
Additional keyword arguments passed to the ``PCA()`` constructor
under ``cv_scheme="row_wise"`` (e.g. ``algorithm="nipals"``).
Expand Down Expand Up @@ -1108,6 +1116,18 @@ def select_n_components( # noqa: PLR0913, PLR0915, C901
- ``cv_scheme`` - the scheme used (``"ekf"`` or ``"row_wise"``).
- ``selection_rule`` - the rule used to pick ``n_components``.

When ``return_consensus=True`` the Bunch also carries four
extra keys sourced from the cheap cross-checks:

- ``minka_n_components`` - :meth:`minka_mle` estimate (int).
- ``parallel_analysis_n_components`` -
:meth:`parallel_analysis` estimate (int).
- ``consensus`` - ``"agree"`` when the three recommendations
lie within one component of one another, ``"disagree"``
otherwise.
- ``consensus_counts`` - the three recommendations as a
``(ekf, minka, parallel_analysis)`` tuple.

References
----------
Bro, R., Kjeldahl, K., Smilde, A. K., & Kiers, H. A. L. (2008).
Expand Down
2 changes: 1 addition & 1 deletion src/process_improve/multivariate/_pls.py
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ def select_n_components( # noqa: C901, PLR0912, PLR0913, PLR0915
distribution signals a confident recommendation; a flat or
multi-modal one flags it for review.
- ``selection_mode`` - the most-voted component count, or
``None`` when ``selection_distribution`` is.
``None`` when ``selection_distribution`` is ``None``.
- ``selection_is_stable`` - ``True`` iff the modal vote share
meets ``stability_threshold``; ``None`` when no distribution
was computed.
Expand Down
Loading