from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split( x, y, test_size=0.2, random_state=4)
from sklearn.neighbors import KNeighborsClassifier
from sklearn import metrics
ans=0
for i in range(2):
neigh = KNeighborsClassifier(n_neighbors = k).fit(X_train,y_train)
Pred_y = neigh.predict(X_test)
if ans<metrics.accuracy_score(y_test, Pred_y):
ans=metrics.accuracy_score(y_test, Pred_y)
print(ans)