output nearest neighbors is is is -nearest neighbors classifier -nearest neighbors (knnclassifier is classification model that uses the nearest neighbors algorithm to classify given data point we have implemented the knn algorithm in the last sectionnow we are going to build knn classifier using that algorithm concept of knn classifier the basic concept of -nearest neighbor classification is to find predefined numberi the 'kof training samples closest in distance to new samplewhich has to be classified new samples will get their label from the neighbors itself the knn classifiers have fixed user defined constant for the number of neighbors which have to be determined for the distancestandard euclidean distance is the most common choice the knn classifier works directly on the learned samples rather than creating the rules for learning the knn algorithm is among the simplest of all machine learning algorithms it has been quite successful in large number of classification and regression problemsfor examplecharacter recognition or image analysis