Closed
Description
Describe the issue linked to the documentation
The example used in the stable TargetEncoder documentation is confusing as the order of the label (that is: dog, cat, snake) is not coherent with the expected order of enc_low_smooth.encodings_
(the 80 corresponds to 'dog' but is is in second order not first).
Printing TargetEncoder.categories_
reveal that the order is indeed coherent with TargetEncoder.encodings_
. However, as I was trying to understand where this difference of order came from, I wasn't able to find in TargetEncoder class definition where self.categories_
was set.
Suggest a potential alternative/fix
- make it more explicit in documentation, such as adding a print of
enc_auto.categories_
- make
TargetEncoder()
preserve the columns order found in the dataset