I am reading a presentation and it recommends not using leave one out encoding, but it is okay with one hot encoding. I thought they both were the same. Can anyone describe what the differences between them are?
-
1$\begingroup$ It's not clear (from just your question) what leave-on-out even is. You should edit this to give a pointer and explain briefly your understanding of the two, and why you think they are the same. $\endgroup$– Sean OwenMar 23, 2016 at 13:31
-
$\begingroup$ leave one out, from scikit learn contrib categorical project $\endgroup$– morkMar 18, 2019 at 8:34
-
$\begingroup$ OHE and LOO are #2 and #10 in 11 Categorical Encoders and Benchmark respectively. $\endgroup$– smciApr 21, 2022 at 7:20
1 Answer
They are probably using "leave one out encoding" to refer to Owen Zhang's strategy.
From here
The encoded column is not a conventional dummy variable, but instead is the mean response over all rows for this categorical level, excluding the row itself. This gives you the advantage of having a one-column representation of the categorical while avoiding direct response leakage
-
1$\begingroup$ Your explanation is better than wacax's in the referred link, thank you $\endgroup$ Aug 12, 2016 at 15:00
-
$\begingroup$ Hi @Dex Groves, so the leave_one_out encoding for the test is always .5? $\endgroup$ Mar 24, 2017 at 20:29
-
3$\begingroup$ Hi! As seen from the picture, this paticular example relates to classification problem. Does anybody have an experience with LOO encoding within regression problem? The main question is how to aggregate the target variable. I am now making experiments and get huge overfitting with mean(y). $\endgroup$ Jun 19, 2017 at 12:49
-
1$\begingroup$ for a clustering (unsupervised) problem, is possible to use this kind of encoding? $\endgroup$– enneppiSep 13, 2018 at 10:26
-
1$\begingroup$ @enneppi - the whole idea is to "tie" your categorical feature to the target "y", which you're missing in your unsupervised ML. You could try "tying" your categorical feature into other X features (a kind of feature engineering) $\endgroup$– morkMar 18, 2019 at 8:46