Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import category_encoders as ce
# create an object of the OneHotEncoder
OHE = ce.OneHotEncoder(cols=['Item_Fat_Content',
'Item_Type',
'Outlet_Identifier',
'Outlet_Size',
'Outlet_Location_Type',
'Outlet_Type'],use_cat_names=True)
# encode the categorical variables
train_data = OHE.fit_transform(train_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment