[BUG] fix _score_params + add tests + fix errors 'masked' by the 'try... except'-block#237
Open
SimonBlanke wants to merge 3 commits intomainfrom
Open
[BUG] fix _score_params + add tests + fix errors 'masked' by the 'try... except'-block#237SimonBlanke wants to merge 3 commits intomainfrom
SimonBlanke wants to merge 3 commits intomainfrom
Conversation
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.
Bug fix:
_score_paramspassed parameters incorrectly_score_paramscalledexperiment(**params), unpacking the dict as keyword arguments.BaseExperiment.__call__expects a single positional dict, so every call raised aTypeErrorthat was silently swallowed by the bareexceptclause. All candidates receivederror_score(NaN) andnp.argmaxalways picked index 0, making optimization results appear stable but entirely meaningless.Fixed by changing
experiment(**params)toexperiment(params). Theexceptclause now also emits awarnings.warnso caught exceptions are no longer silent.Fix: deterministic test parameters for
TSCOptCVThe corrected
_score_paramsexposed non-determinism inTSCOptCV.get_test_params: the"stratified"DummyClassifier strategy produces random predictions, and the default CV usedshuffle=Truewithout a fixed seed. Together these causedtest_fit_idempotentto fail intermittently.Fixed by replacing
"stratified"with"prior"(deterministic) and pinningcv=KFold(n_splits=2, shuffle=False).Enhancement:
_predict_probaoverride forTSCOptCVTSCOptCVoverrode_predictwith arefit=Falseguard but left_predict_probaunoverridden. Withrefit=False,predictraisedRuntimeErrorwhilepredict_probasilently delegated to an unfitted estimator. Added the same guard to_predict_proba.Tests
Added unit tests for
_score_paramscovering correct dict passing, return type, error score fallback, and warning emission.