Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #Label encode and hot encode categorical columns
  2. from sklearn.preprocessing import LabelEncoder
  3. le = LabelEncoder()
  4. X_categorical = X_categorical.apply(LabelEncoder().fit_transform)
  5. X_to_predict_categorical = X_to_predict_categorical.apply(LabelEncoder().fit_transform)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement