Skip to content

Fix/search cv - #8

Merged
lialber2 merged 12 commits into
devfrom
fix/searchCV
Mar 20, 2022
Merged

lialber2 merged 12 commits into
devfrom
fix/searchCV

Conversation

@pasaaliaslan

Copy link
Copy Markdown
Collaborator

####Reference Issues/PRs
Fixes scikit-learn#21895

####What does this implement/fix? Explain your changes.
When there are multiple params with rank=1, GridSearchCV and RandomizedSearchCV fit.best_params_ would return the first one in the order params appear in the list. However, when given the exact same params in different order, fit.best_params_ might return a different param, creating an ambiguity.

To solve this issue, lexicographical order of the params are considered instead of the order they appear in the list. In this way, independent from the order params are given, fit.best_params_ will return exactly the same output.

Lexicographical order is decided with the attributes of the estimators being used and order is calculated with _hash_param_values method.

@lialber2 lialber2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@trinhcon trinhcon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ran tests locally and they passed

@lialber2
lialber2 merged commit 85dbb9f into dev Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants