-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement MetaLearnerGridSearch #9
Conversation
Co-authored-by: Kevin Klein <[email protected]>
Speedup tests
Switch `strict` meaning in `validate_number_positive`
Co-authored-by: Kevin Klein <[email protected]>
Co-authored-by: Kevin Klein <[email protected]>
Co-authored-by: Kevin Klein <[email protected]>
Two thoughts:
What do you think of these options? |
I think this could work but we would have the same problem as we had when synchronizing of needing to pass the indices as just with
I think this is quite nice but the problem is at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly small things :)
metalearners/grid_search.py
Outdated
"base_learner_grid keys don't match the expected model names. base_learner_grid " | ||
f"keys were expected to be {self.models_to_fit}." | ||
) | ||
self.base_learner_grid = list(ParameterGrid(base_learner_grid)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I don't quite see yet why we need/want the transformation from
{key: [value1, value2, value3]}
to [{key: value1}, {key: value2}, {key: value3}]
:/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need it at the __init__
so I moved this conversion to the fit
.
d6c8c3f
Co-authored-by: Kevin Klein <[email protected]>
Co-authored-by: Kevin Klein <[email protected]>
Co-authored-by: Kevin Klein <[email protected]>
Co-authored-by: Kevin Klein <[email protected]>
Co-authored-by: Kevin Klein <[email protected]>
Co-authored-by: Kevin Klein <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you! :)
This PR implements
GridSearchCV
which performs an exhaustive search over all the parameters combination. I restricted the search to only one type of metalearner because the model names are different for each metalearner and therefore there were many cases and the user can perform one search for each metalearner type and would be the same.With the current setup model reusage does not work. This is because the grid search performs data splitting and therefore in-sample predictions for training evaluation can't be performed. One option would be to only compute test losses or not support model reusage.
Checklist
CHANGELOG.rst
entry