You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pipeline should use fit_transform in fit_predict #7558
It is here, but not properly in my opinion.
Pipeline object in this test uses the same scaler object that was used earlier to calculate expected result. Therefore this call of check_is_fitted doesn't fail and the test passes.
Hm @jnothman I am somewhat confused. I thought we'd be cloning estimators on pipeline construction. Was it a deliberate choice not to clone when we set the steps?
I don't think you should fix the lack of cloning. @amueller, I consider this to be among Pipeline's "legacy" behaviour. It's been around for a long time and we'll break lots of code by changing its behaviour. Pipeline also modifies a constructor param in fit rather than setting a new _-trailed attr.
Activity
amueller commentedon Oct 3, 2016
wow this is a pretty bad bug. Is
fit_predictnot tested?gszpak commentedon Oct 3, 2016
It is here, but not properly in my opinion.
Pipeline object in this test uses the same
scalerobject that was used earlier to calculate expected result. Therefore this call ofcheck_is_fitteddoesn't fail and the test passes.amueller commentedon Oct 3, 2016
Do you want to fix this, and the test?
Hm @jnothman I am somewhat confused. I thought we'd be cloning estimators on pipeline construction. Was it a deliberate choice not to clone when we set the steps?
gszpak commentedon Oct 3, 2016
Sure, I'll fix both.
jnothman commentedon Oct 4, 2016
I don't think you should fix the lack of cloning. @amueller, I consider this to be among Pipeline's "legacy" behaviour. It's been around for a long time and we'll break lots of code by changing its behaviour. Pipeline also modifies a constructor param in
fitrather than setting a new_-trailed attr.Yes, fix
fit_predict.BUGFIX Calling fit_transform instead of transform in Pipeline's fit_p…
amueller commentedon Oct 5, 2016
Ugh I should remember that. Should we add that to the docs somewhere?
jnothman commentedon Oct 5, 2016
Perhaps we should document it; perhaps we should ensure it's tested; and it should at least be commented.
gszpak commentedon Oct 6, 2016
I can add it to
test_pipeline_init(or add a separate test) if you don't mind.jnothman commentedon Oct 6, 2016
Perhaps as a separate PR. I'd rather merge the fix first.
jnothman commentedon Oct 6, 2016
Thanks for catching and fixing this, @gszpak
[MRG] FIX Calling fit_transform instead of transform in Pipeline's fi…
amueller commentedon Oct 7, 2016
@gszpak if you like you can open an issue and/or PR for the tests and doc. That would be much appreciated.
gszpak commentedon Oct 9, 2016
Sure, will do:)
[MRG] FIX Calling fit_transform instead of transform in Pipeline's fi…
[MRG] FIX Calling fit_transform instead of transform in Pipeline's fi…
[MRG] FIX Calling fit_transform instead of transform in Pipeline's fi…