Created
November 26, 2019 08:48
-
-
Save analyticsindiamagazine/04ab6af70a518f4e5695301e929284be 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
#Filling Nulls/Nans | |
train.fillna('NAN', inplace = True) | |
#Label Encoding | |
from sklearn.preprocessing import LabelEncoder | |
le_c = LabelEncoder().fit(unique_cuisines) | |
train['Cuisines'] = le_l.transform(train['Cuisines']) | |
#Scaling | |
cols = [list of columns to apply standard scaler] | |
from sklearn.preprocessing import StandardScaler | |
ss = StandardScaler() | |
train[cols] = ss.fit_transform(train_sample[cols]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment