values of n_neighbors as we can see from the plotusing only single neighboreach point in the training set has an obvious influence on the predictionsand the predicted values go through all of the data points this leads to very unsteady prediction considering more neighbors leads to smoother predictionsbut these do not fit the training data as well strengthsweaknessesand parameters in principlethere are two important parameters to the kneighbors classifierthe number of neighbors and how you measure distance between data points in practiceusing small number of neighbors like three or five often works wellbut you should certainly adjust this parameter choosing the right distance measure is somewhat beyond the scope of this book by defaulteuclidean distance is usedwhich works well in many settings one of the strengths of -nn is that the model is very easy to understandand often gives reasonable performance without lot of adjustments using this algorithm is good baseline method to try before considering more advanced techniques building the nearest neighbors model is usually very fastbut when your training set is very large (either in number of features or in number of samplesprediction can be slow when using the -nn algorithmit' important to preprocess your data (see chapter this approach often does not perform well on datasets with many features (hundreds or more)and it does particularly badly with datasets where most features are most of the time (so-called sparse datasetssowhile the nearest -neighbors algorithm is easy to understandit is not often used in practicedue to prediction being slow and its inability to handle many features the method we discuss next has neither of these drawbacks supervised learning