data point and one column per feature the array is one-dimensional arraywhich here contains one class labelan integer ranging from to for each of the samples we split our dataset into training setto build our modeland test setto evaluate how well our model will generalize to newpreviously unseen data we chose the -nearest neighbors classification algorithmwhich makes predictions for new data point by considering its closest neighbor(sin the training set this is implemented in the kneighborsclassifier classwhich contains the algorithm that builds the model as well as the algorithm that makes prediction using the model we instantiated the classsetting parameters then we built the model by calling the fit methodpassing the training data (x_trainand training outputs (y_trainas parameters we evaluated the model using the score methodwhich computes the accuracy of the model we applied the score method to the test set data and the test set labels and found that our model is about accuratemeaning it is correct of the time on the test set this gave us the confidence to apply the model to new data (in our examplenew flower measurementsand trust that the model will be correct about of the time here is summary of the code needed for the whole training and evaluation procedurein[ ]x_trainx_testy_trainy_test train_test_splitiris_dataset['data']iris_dataset['target']random_state= knn kneighborsclassifier(n_neighbors= knn fit(x_trainy_trainprint("test set score{ }format(knn score(x_testy_test))out[ ]test set score this snippet contains the core code for applying any machine learning algorithm using scikit-learn the fitpredictand score methods are the common interface to supervised models in scikit-learnand with the concepts introduced in this you can apply these models to many machine learning tasks in the next we will go into more depth about the different kinds of supervised models in scikit-learn and how to apply them successfully introduction