Nearest centroid classifier

From HandWiki
Short description: A classification model in machine learning based on centroids
Rocchio Classification

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 word vectors containing tf*idf weights to represent documents, the nearest centroid classifier is known as the Rocchio classifier because of its similarity to the Rocchio algorithm for relevance feedback.[1]

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

Algorithm

Training

Given labeled training samples [math]\displaystyle{ \textstyle\{(\vec{x}_1, y_1), \dots, (\vec{x}_n, y_n)\} }[/math] with class labels [math]\displaystyle{ y_i \in \mathbf{Y} }[/math], compute the per-class centroids [math]\displaystyle{ \textstyle\vec{\mu}_\ell = \frac{1}{|C_\ell|}\underset{i \in C_\ell}{\sum} \vec{x}_i }[/math] where [math]\displaystyle{ C_\ell }[/math] is the set of indices of samples belonging to class [math]\displaystyle{ \ell \in \mathbf{Y} }[/math].

Prediction

The class assigned to an observation [math]\displaystyle{ \vec{x} }[/math] is [math]\displaystyle{ \hat{y} = {\arg\min}_{\ell \in \mathbf{Y}} \|\vec{\mu}_\ell - \vec{x}\| }[/math].

See also

References

  1. Manning, Christopher; Raghavan, Prabhakar; Schütze, Hinrich (2008). "Vector space classification". Introduction to Information Retrieval. Cambridge University Press. http://nlp.stanford.edu/IR-book/html/htmledition/rocchio-classification-1.html. 
  2. Tibshirani, Robert; Hastie, Trevor; Narasimhan, Balasubramanian; Chu, Gilbert (2002). "Diagnosis of multiple cancer types by shrunken centroids of gene expression". Proceedings of the National Academy of Sciences 99 (10): 6567–6572. doi:10.1073/pnas.082099299. PMID 12011421.