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
instantiating a ColumnTransformer with already fitted transformers #13614
Comments
No you can't. What use case do you have, seeing as the applicable columns
of the input are only identified when fitting the column transformer?
|
Recently spoke to someone that is running into this issue. He fitted a transformer on unlabeled data and they he created a metaestimator to wrap this transformer in order to freeze it (by overwriting He also mentioned how this worked in |
Yes, cloning is precisely why freezing needs a specialised solution. It's
very hard for a user unfamiliar with scikit-learn internals to fix.
|
I have another use case where I want to fit two target encoders not on the target label but on other labels (e.g. email domains we get many clicks from, whereas the final target is a user buying). So basically I have 3 y vectors. Fitting has to happen outside of column transformer, then the fitted transformers would be passed to column transformer. Great hint about "clone"! Helps to find a workaround. |
Why not pass |
was anyone able to find a solution to this? |
Can I instantiate a ColumnTransformer with already fitted transformers? I get an error right now saying the
fit
wasn't called onColumnTransformer
. I don't want to callfit
on the transformer since I am using already fitted transformers and just want to useColumnTransformer
to aggregate the columns into a matrix.The text was updated successfully, but these errors were encountered: