Repository navigation
Update clone() for pipelines and components to copy over random state by default - #1753
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1753 +/- ##
=========================================
- Coverage 100.0% 100.0% -0.0%
=========================================
Files 247 247
Lines 19598 19574 -24
=========================================
- Hits 19589 19565 -24
Misses 9 9
Continue to review full report at Codecov.
|
| assert clf.parameters == clf_clone.parameters | ||
|
|
||
|
|
||
| def test_clone_random_state(): |
There was a problem hiding this comment.
Don't need this test specifically anymore.
| pipeline_clone = pipeline.clone(random_state=42) | ||
| assert pipeline_clone.random_state == pipeline.random_state | ||
|
|
||
| pipeline = linear_regression_pipeline_class(parameters=parameters, random_state=2) |
There was a problem hiding this comment.
Was duplicated checks? 🤔 Either way, not necessary anymore.
|
|
||
| def test_nonlinear_clone_init(nonlinear_regression_pipeline_class): | ||
| @pytest.mark.parametrize("is_linear", [True, False]) | ||
| def test_clone_init(is_linear, linear_regression_pipeline_class, nonlinear_regression_pipeline_class): |
There was a problem hiding this comment.
Combined test_clone_init and test_nonlinear_clone_init via parametrize
|
|
||
| def test_clone_fitted(X_y_binary, logistic_regression_binary_pipeline_class): | ||
| @pytest.mark.parametrize("is_linear", [True, False]) | ||
| def test_clone_fitted(is_linear, X_y_binary, logistic_regression_binary_pipeline_class, nonlinear_binary_pipeline_class): |
There was a problem hiding this comment.
Combined test_nonlinear_clone_fitted and test_clone_fitted via parametrize
chukarsten
left a comment
There was a problem hiding this comment.
I really like the subtractions in this PR. Very well done.
Closes #1340