Repository navigation
Check metric constraints when the constrained metric is exactly zero - #1671
Open
Mohammad Sohail Shaikh (sohailshk) wants to merge 1 commit into
Open
Mohammad Sohail Shaikh (sohailshk) wants to merge 1 commit into
Mohammad Sohail Shaikh (sohailshk) wants to merge 1 commit into
Conversation
BlendSearch.on_trial_complete() read the constrained metric with 'if value:', so a reported value of 0 (for example recall 0.0 against recall >= 0.5) skipped the constraint and the trial was treated as feasible. Only skip when the metric is missing.
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.
Why are these changes needed?
BlendSearch.on_trial_complete()applies the penalty onlyif value:, so a reported 0 / 0.0 skipped the constraint: withmetric_constraints=[("recall", ">=", 0.5)]a trial reportingrecall=0.0was treated as feasible (its lagrange objective equal to the raw objective). Now the constraint is skipped only when the metric is missing (if value is not None).Test: recall is 0.0 above x=5 with
mode="max"; infeasible trials must get a lagrange-modified score below the raw score, feasible ones the raw score. It fails on main (7.71 < 7.71) and passes now.Related issue number
Same pattern as #1603 (FLOW2 /
tune.report); this check was not part of it.Checks
Checks run: the new test, the tune/automl constraint tests and test_tune/test_lexiflow (9 passed, 1 skipped); black (line length 120) and ruff on the changed files. The pinned pre-commit hook versions were not run. No doc changes are needed.