feature-engine / feature_engine

Feature engineering package with sklearn like functionality
https://feature-engine.trainindata.com/
BSD 3-Clause "New" or "Revised" License
1.8k stars 303 forks source link

fix various bugs in RareLabelEncoder #665

Closed solegalli closed 1 year ago

solegalli commented 1 year ago

closes #651

solegalli commented 1 year ago

Hey @ClaudioSalvatoreArcidiacono

This PR should resolve the issue of rare labels not working with column transformer.

I tested it, it worked fine for me.

Would you like to double check before I merge?

solegalli commented 1 year ago

Mess was introduced in last version when allowing it to work with NAN. Lots of tiny nasty bugs here and there :_(

ClaudioSalvatoreArcidiacono commented 1 year ago

Hey @ClaudioSalvatoreArcidiacono

This PR should resolve the issue of rare labels not working with column transformer.

I tested it, it worked fine for me.

Would you like to double check before I merge?

Hey @solegalli! thanks a lot for picking up this issue!

May I suggest to add a unit test checking that the piece of code that I had in the issue page (or something equivalent) works as expected ?

solegalli commented 1 year ago

Hey @ClaudioSalvatoreArcidiacono

Thank you for the suggestion. I thought of it. but our transformers are not designed to work with the ColumnTransformer. They do naturally because we try to be as compatible as possible with the sklearn API.

So I'd rather not include that test. Cheers