Repository navigation
Conversation
Preserve sklearn's estimator-return protocol in both optimizer parameter-update overrides. Verify exact cross-validation scores, direct and nested searches, and unchanged validation contracts.
This branch has not been deployed
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.
Direct
GridSearchCVoverSTLSQcallsset_params(...).fit(...), so returningNonecurrently breaks the estimator protocol. This patch returnsselffromBaseOptimizer.set_paramsandTrappingSR3.set_paramsafter their existing parameter-update behavior.Six regressions cover empty and changed updates, direct and nested grid searches, and independently derived cross-validation scores. On the current upstream baseline
c4421fcec275c8f4cc5c1e93bebb961b212067ae, the new cases give 5 failures and 1 passing control. With the patch, all 6 pass.Validation on the three changed files:
.flake8: no findings.Focused tests ran on CPython 3.12, NumPy 2.3.5, SciPy 1.17.0, scikit-learn 1.8.0, cvxpy 1.9.3 and pytest 7.4.4:
The shared upstream
conftest.pyimports JAX, which was unavailable in this environment; these tests use no shared fixtures. The full optional test suite and documentation build were not run. Upstream CI is pending.