-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat(core): implement a more robust set_params()
#162
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #162 +/- ##
==========================================
+ Coverage 87.37% 88.70% +1.32%
==========================================
Files 27 27
Lines 1964 2009 +45
==========================================
+ Hits 1716 1782 +66
+ Misses 248 227 -21 ☔ View full report in Codecov by Sentry. |
) | ||
|
||
|
||
def test_set_params_updates_valid_params(): |
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.
Can you add a test that constructs a sklearn pipeline with a recipe, then calls the pipeline's get_params
and set_params
as sklearn would to ensure everything is plumbed through correctly?
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 didn't add anything here since test_can_use_in_sklearn_pipeline
already covers that case (and was failing until got it "right").
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.
That's probably the better place for it, but that test doesn't hit the setting nested parameters workflow directly. Can you add one that does something like:
pipe = ...
pipe.set_params(recipe__step__something="foo")
# then assert the nested thing was set
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.
It is hitting it, but I've made more explicit in effadce
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.
@jcrist if this looks good, I will go ahead and merge!
7b00324
to
7416c23
Compare
d69ed52
to
9cc99cf
Compare
Related to #135 and #136
Before this PR, it wasn't possible to call
set_params()
onStep
objects, andRecipe.set_params()
only trivially set thesteps
param. With this PR, you can actually set the parameters listed byRecipe.get_params()
(andStep.get_params()
), which is more robust and akin to scikit-learn.