the -nn algorithm is arguably the simplest machine learning algorithm building the model consists only of storing the training dataset to make prediction for new data pointthe algorithm finds the closest data points in the training dataset--its "nearest neighbors -neighbors classification in its simplest versionthe -nn algorithm only considers exactly one nearest neighborwhich is the closest training data point to the point we want to make prediction for the prediction is then simply the known output for this training point figure - illustrates this for the case of classification on the forge datasetin[ ]mglearn plots plot_knn_classification(n_neighbors= figure - predictions made by the one-nearest-neighbor model on the forge dataset herewe added three new data pointsshown as stars for each of themwe marked the closest point in the training set the prediction of the one-nearest-neighbor algorithm is the label of that point (shown by the color of the crosssupervised machine learning algorithms