Created
January 28, 2020 09:56
-
-
Save lakshay-arora/64cd057fc97221f59f505c63071625fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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