Created
February 29, 2020 06:35
-
-
Save amkurian/0ae34d391b339d8677da129548747fbd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from sklearn.preprocessing import LabelEncoder, OneHotEncoder | |
labelencoder_X = LabelEncoder() | |
X[:, 0] = labelencoder_X.fit_transform(X[:, 0]) | |
onehotencoder = OneHotEncoder(categorical_features = [0]) | |
X = onehotencoder.fit_transform(X).toarray() | |
# Encoding the Dependent Variable | |
labelencoder_y = LabelEncoder() | |
y = labelencoder_y.fit_transform(y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment