Add configurable convergence criterion ordering and per-criterion ena…#102
Merged
Merged
Conversation
…ble/disable - Add DEFAULT_CRITERION_ORDER constant and _VALID_CRITERION_NAMES to _converge.py - Refactor convergence_check() to use a dict-based registry with configurable ordering (criterion_order) and per-criterion enable/disable (convergence_criteria) - Add criterion_order and convergence_criteria defaults to _build_options() - Extract _validate_convergence_opts() helper for input validation - Surface criterion_order and convergence_criteria as named kwargs on VBPCA.__init__ - Forward both options through VBPCA.fit() and VBPCA.get_options() - Add tests for reordering, disabling, combined usage, and validation errors - Update convergence concept and howto documentation with new options Fixes #101
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.
This pull request introduces significant improvements to the convergence criteria system in the VBPCA implementation. It adds support for customizable priority ordering of convergence criteria and per-criterion enable/disable controls, making model convergence more flexible and user-configurable. These features are fully documented, validated, and tested throughout the codebase.
Enhancements to convergence criteria configuration:
criterion_orderoption to allow users to specify the priority order in which convergence criteria are evaluated, instead of using a fixed order. (src/vbpca_py/_converge.py,src/vbpca_py/estimators.py,src/vbpca_py/_pca_full.py, [1] [2] [3] [4]convergence_criteriaoption to enable or disable individual convergence criteria without affecting their diagnostic evaluation. (src/vbpca_py/_converge.py,src/vbpca_py/estimators.py,src/vbpca_py/_pca_full.py, [1] [2] [3] [4]Validation and error handling:
_build_optionsto check for unknown or incorrectly typed criterion names in bothcriterion_orderandconvergence_criteria, raising informative errors for invalid input. (src/vbpca_py/_pca_full.py, [1] [2]Estimator API and forwarding:
VBPCAestimator to accept and forwardcriterion_orderandconvergence_criteriathrough its API, ensuring these options are correctly passed to the underlying implementation. (src/vbpca_py/estimators.py, [1] [2] [3] [4] [5]Documentation and usage examples:
docs/concepts/convergence.md,docs/howto/convergence.md, [1] [2]Testing:
tests/test_converge.py,tests/test_estimators.py, [1] [2]Closes #101