x_test scaler transform(x_testnexttrain the model with the help of kneighborsclassifier class of sklearn as followsfrom sklearn neighbors import kneighborsclassifier classifier kneighborsclassifier(n_neighbors= classifier fit(x_trainy_trainat last we need to make prediction it can be done with the help of following scripty_pred classifier predict(x_testnextprint the results as followsfrom sklearn metrics import classification_reportconfusion_matrixaccuracy_score result confusion_matrix(y_testy_predprint("confusion matrix:"print(resultresult classification_report(y_testy_predprint("classification report:",print (result result accuracy_score(y_test,y_predprint("accuracy:",result output confusion matrix[[ ]classification reportprecision recall -score support iris-setosa iris-versicolor iris-virginica micro avg macro avg weighted avg