fix: select_n_components respects xprobe_fraction for prms/cost - #123
Merged
jc-macdonald merged 1 commit intoAug 25, 2026
Merged
Conversation
_ensure_metric_opts auto-generates a held-out probe set whenever the caller hasn't supplied an explicit xprobe array, but it only checked for that array -- never the caller's own xprobe_fraction -- so it always fell back to a hardcoded 10% probe fraction regardless of what was configured (e.g. via recommend_config()). This affected both the "prms" and "cost" metrics equally, since the function doesn't gate on cfg.metric at all. Found while investigating a pp-eigentest trade-study result comparing cost vs prms for VBPCA-based rank selection (yoavram-lab/pp-eigentest#21).
jc-macdonald
deleted the
fix/122-xprobe-fraction-ignored-in-metric-opts
branch
August 25, 2026 13:47
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.
Closes #122.
Summary
_ensure_metric_opts(used internally byselect_n_componentsto auto-generate a held-out probe set for theprms/costmetrics) only checked whether an explicitxprobearray was supplied -- never the caller's ownxprobe_fraction. It always fell back to a hardcoded 10% probe fraction, silently discarding a tunedxprobe_fraction(e.g. fromrecommend_config()). Affects both"prms"and"cost"equally, since the function doesn't gate oncfg.metric.fit_opts["xprobe_fraction"]when it's a positive value, falling back to the historical 10% default only when unset/zero -- same behavior as before for anyone not passingxprobe_fraction.Test plan
_ensure_metric_opts: respects a configuredxprobe_fraction, and falls back to the 10% default when unset.ruff format --preview --check/ruff check --preview-- cleanmypy --strict src-- cleanpytest -q -m "not perf and not octave"-- 496 passed (0 regressions)