You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CategoricalImputer fails when fill_value is already a category #1113
This raises ValueError: new categories must not include old categories: {'unknown'}. I expected ['east', 'unknown', 'west'], with the categorical dtype preserved. It also fails with an ordered categorical; the equivalent object column works.
Reproduced on current main (d866312), Python 3.12, pandas 2.3.3 and scikit-learn 1.7.2. This is related to #1095, but #1096 changes RareLabelEncoder, not this imputer's separate add_categories call.
I'm happy to contribute the fix and regression tests, and I'm planning to work on this.
Activity