Rahul Sharma (Editor)

Nearest centroid classifier

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Nearest centroid classifier

In machine learning, a nearest centroid classifier or nearest prototype classifier is a classification model that assigns to observations the label of the class of training samples whose mean (centroid) is closest to the observation.

When applied to text classification using tf*idf vectors to represent documents, the nearest centroid classifier is known as the Rocchio classifier because of its similarity to the Rocchio algorithm for relevance feedback.

An extended version of the nearest centroid classifier has found applications in the medical domain, specifically classification of tumors.

Algorithm

  • Training procedure: given labeled training samples { ( x 1 , y 1 ) , , ( x n , y n ) } with class labels y i Y , compute the per-class centroids μ l = 1 | C l | i C l x i where C l is the set of indices of samples belonging to class l Y .
  • Prediction function: the class assigned to an observation x is y ^ = arg min l Y μ l x .
  • References

    Nearest centroid classifier Wikipedia