Skip to content

Instantly share code, notes, and snippets.

Last active Sep 10, 2019
What would you like to do?
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