Give each per-variable QRF model its own seed - #214
Open
vahid-ahmadi wants to merge 2 commits into
Open
vahid-ahmadi wants to merge 2 commits into
vahid-ahmadi wants to merge 2 commits into
Conversation
Every per-variable model builds its own generator from the seed it is given, and all of them were handed self.seed. They therefore drew the same random quantiles in the same row order, so variables imputed together came out rank-comonotonic whatever their dependence in the donor: three targets with nil conditional dependence reproduced at 0.71 Spearman, 0.11 after this change. The offset follows the convention already used for the subsampling seed in _apply_max_train_samples. QRF also now accepts a seed argument; there was previously no way for a caller to vary the draws. Fixes #207
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Fixes #207.
QRF now derives a distinct random seed for each target during fitting, target-specific subsampling, and numeric and categorical hyperparameter tuning. This removes the shared random quantile stream that coupled stochastic predictions across targets.
QRF(seed=...)lets callers control reproducibility.Child seeds stay within sklearn's supported range even when the base seed is
4294967295. Ordinary seeds retain the per-target values introduced by this PR,Noneremains supported, and invalid base seeds remain invalid.The stochastic output changes relative to main, so downstream datasets using joint draws need regeneration and checks of joint-tail statistics. The Markdown examples also pass the repository formatter.
Validation: 12 new seed regressions first produced 6 failures and 6 passing controls, then the affected suite passed all 113 tests.
Final commit:
5a8b81e42236fc6f0d981b91663411a8d58c7e1f. All eight checks passed. Python 3.14 CI passed 367 tests with 2 skipped, including all 13 real R/StatMatch Matching tests; the pipeline example passed. Python 3.12 smoke tests, documentation, lint, changelog and deployment checks also passed. The two skipped modules require optional MDN dependencies. Coverage XML was generated; the existing Codecov upload step reported its nonblocking protected-branch token error.The exact final heads of #214, #215, #216 and #217 also merge cleanly together. Their combined suite passed 350 tests with 3 optional skips, and the combined source distribution, wheel, import and numerical smoke checks passed. Merge these before #219, then rebase #219 while retaining its broader correctness fixes.