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 395 forks source link

Unexpected input dimension when encoding new data frame #357

Closed borisRa closed 2 years ago

borisRa commented 2 years ago

Expected Behavior

Expecting only transformed columns. My data frame had 380 cols, with ONLY 3 categorical to encode. When I wanted to encode this 3 cols in another data frame I got this error :

ValueError: Unexpected input dimension 300, expected 380

The question is why ?

Actual Behavior

Expecting all columns that were in the original data frame . ValueError: Unexpected input dimension 300, expected 380

Steps to Reproduce the Problem

final_df_cat_encoder.transform(final_df )

Specifications

PaulWestenthanner commented 2 years ago

Hi @borisRa please check the discussion in #355 which is basically the same issue.