Last active
September 10, 2019 12:42
-
-
Save purva91/db39bbe91f852dac8af113a64a050e66 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
y = data_df["target"].values | |
x = data_df.drop(["target"],axis=1) | |
#Scaling - mandatory for knn | |
from sklearn.preprocessing import StandardScaler | |
ss = StandardScaler() | |
x = ss.fit_transform(x) | |
#SPlitting into train and test | |
X_train, X_test, y_train, y_test = train_test_split(x, y, test_size = 0.3) # 70% training and 30% test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment