Repository navigation
Update start_iteration_callback to accept pipeline instance instead of pipeline class - #2290
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2290 +/- ##
=========================================
- Coverage 100.0% 100.0% -0.0%
=========================================
Files 280 280
Lines 24410 24396 -14
=========================================
- Hits 24387 24373 -14
Misses 23 23
Continue to review full report at Codecov.
|
| else: | ||
| pipeline_class = nonlinear_regression_pipeline_class | ||
|
|
||
| def test_automl_regression_nonlinear_pipeline_search(nonlinear_regression_pipeline_class, X_y_regression): |
|
|
||
| pipeline_class = dummy_multiclass_pipeline_class if is_linear else nonlinear_multiclass_pipeline_class | ||
|
|
||
| def test_automl_multiclass_nonlinear_pipeline_search_more_iterations(nonlinear_multiclass_pipeline_class, X_y_multi): |
There was a problem hiding this comment.
Kind of confused by what this test was testing (that multiclass with more iterations will produce the right pipelines..?), but combined with above :)
There was a problem hiding this comment.
Sounds good! Yeah looking at this now, I'm not sure either haha. It feels like it could be an automl algo test which we put in automl search before those concepts had separation. Idk!
dsherry
left a comment
There was a problem hiding this comment.
Looks great! I had two small changes to request: I think we should delete the parameters argument, and let's list this in breaking changes in the release notes.
| * Changed the default parameter values for ``Elastic Net Classifier`` and ``Elastic Net Regressor`` :pr:`2269` | ||
| * Fixes | ||
| * Changes | ||
| * Updated ``start_iteration_callback`` to accept a pipeline instance instead of a pipeline class :pr:`2290` |
There was a problem hiding this comment.
This is a bit of a nit-pick, but technically we should add a breaking change entry too, because this is going out in a different release from the pipeline API change.
|
|
||
| pipeline_class = dummy_multiclass_pipeline_class if is_linear else nonlinear_multiclass_pipeline_class | ||
|
|
||
| def test_automl_multiclass_nonlinear_pipeline_search_more_iterations(nonlinear_multiclass_pipeline_class, X_y_multi): |
There was a problem hiding this comment.
Sounds good! Yeah looking at this now, I'm not sure either haha. It feels like it could be an automl algo test which we put in automl search before those concepts had separation. Idk!
| assert start_iteration_callback.call_args_list[4][0][0] == nonlinear_multiclass_pipeline_class | ||
| assert isinstance(start_iteration_callback.call_args_list[0][0][0], expected_mock_class) | ||
| for i in range(1, 5): | ||
| assert isinstance(start_iteration_callback.call_args_list[i][0][0], pipeline_class) |
| def _pre_evaluation_callback(self, pipeline): | ||
| if self.start_iteration_callback: | ||
| self.start_iteration_callback(pipeline.__class__, pipeline.parameters, self) | ||
| self.start_iteration_callback(pipeline, pipeline.parameters, self) |
There was a problem hiding this comment.
While we're making a breaking change here: I think we should delete the parameters argument.
Why: now that we're providing a pipeline instance, the start iteration callback can access the parameters by calling pipeline.parameters, so there's no need for that to also be provided as a standalone arg.
freddyaboulton
left a comment
There was a problem hiding this comment.
@angela97lin Looks good! Don't have much to add beyond @dsherry 's comments.
Closes #2282