scikit-learn-contrib / category_encoders

A library of sklearn compatible categorical variable encoders
http://contrib.scikit-learn.org/category_encoders/
BSD 3-Clause "New" or "Revised" License
2.41k stars 396 forks source link

Add a warning when encoders are used with an inappropriate target type #335

Closed jona-sassenhagen closed 2 years ago

jona-sassenhagen commented 2 years ago

I suggest adding a warning when QuantileEncoder is used with a target that is auto-detected as categorical. I can probably do the PR myself.

PaulWestenthanner commented 2 years ago

Hi Jona, this is a good idea. I'm in favour of implementing it. However I wouldn't just add it just to single encoders only, it should rather fit in the general structure of the repository. The road we should be going is establishing some encoder base classes (c.f. #325 and #326 ) and then tackle the issue of adding metadata (e.g. supported targets, c.f. #166 ). With this metadata we'd have a streamlined way of raising such a warning. I think it makes sense to finish the restructuring and stream-lining of encoders first, before adding new features. In the meantime you're welcome to follow the discussion on the two different approaches of introducing a base encoder (#325 and #326) and add your two cents.

jona-sassenhagen commented 2 years ago

Thanks, makes sense!