passing y to .transform() in pipeline
Any chance Pipeline will allow the target (y) to be passed to transformers? I'm not talking about transforming y, although that would be nice. I'm just talking about having y passed as an argument to transformers in the .transform() call. That would allow me to easily run my own target encoders. Currently, not having y available during .transform() is very restrictive. Thanks! -- Florin Andrei https://florin.myip.org/
A favor could I ask you to help me where does this transfer arrive the location El vie., 14 de julio de 2023 3:05 p. m., Florin Andrei < florin@andrei.myip.org> escribió:
Any chance Pipeline will allow the target (y) to be passed to transformers?
I'm not talking about transforming y, although that would be nice.
I'm just talking about having y passed as an argument to transformers in the .transform() call. That would allow me to easily run my own target encoders.
Currently, not having y available during .transform() is very restrictive.
Thanks!
-- Florin Andrei https://florin.myip.org/ _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
The reason to separate fit from transform is to have a operation (transform) that does not use the "y". Indeed, in supervised learning, when not at fit time, the y is not available. If your setting is that you never have a situation where y is not available and you want to transform the data using y, you may want to define fit_transform and not define fit or transform. You should then be able to call fit_transform on the Pipeline. Not however that this is a bit of an unusual pattern in scikit-learn, as it is not a classic setting of machine learning. Cheers, Gaël On Jul 14, 2023, 23:07, at 23:07, Florin Andrei <florin@andrei.myip.org> wrote:
Any chance Pipeline will allow the target (y) to be passed to transformers?
I'm not talking about transforming y, although that would be nice.
I'm just talking about having y passed as an argument to transformers in the .transform() call. That would allow me to easily run my own target encoders.
Currently, not having y available during .transform() is very restrictive.
Thanks!
-- Florin Andrei https://florin.myip.org/ _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
participants (3)
-
Axel Yair Rodriguez Garcia -
Florin Andrei -
Gaël Varoquaux