In k-NN classification, the output is a class membership. An object is classified by a majority vote of its neighbors, with the object being assigned to the class most common among its k nearest neighbors (k is a positive integer, typically small).
- If k = 1, then the object is simply assigned to the class of that single nearest neighbor.
- If k=3, and the class labels are Good =2 Bad=1,then the predicted class label will be Good,which contains the majority vote.
- If k=4, and the class labels are Good =2 Bad=2, What will be the class label?