[scikit-learn] target encoder: fit_transform vs fit.transform

Sole Galli solegalli at protonmail.com
Mon Mar 18 09:37:19 EDT 2024


Hey team,

I am going over the TargetEncoder documentation and I want to make sure I understand this correctly.

Is the intention of fit_transform's cross fit just to understand/ analyse / determine somehow how this transformer would perform?

Because if I got this right, the attribute values (category-number mappings) are determined over the entire training set, both in fit_transform and fit, so when we call transform over a new data set, say test, we'd obtain the same result regardless of whether we fit the transformer with fit or fit_transform. Correct?

Thank you for your input!
Best
Sole

Sent with [Proton Mail](https://proton.me/) secure email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/scikit-learn/attachments/20240318/7480c89d/attachment.html>


More information about the scikit-learn mailing list