Jump to content
Wikipedia The Free Encyclopedia

Nearest centroid classifier

From Wikipedia, the free encyclopedia
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

[edit ]

Training

[edit ]

Given labeled training samples { ( x 1 , y 1 ) , , ( x n , y n ) } {\displaystyle \textstyle \{({\vec {x}}_{1},y_{1}),\dots ,({\vec {x}}_{n},y_{n})\}} {\displaystyle \textstyle \{({\vec {x}}_{1},y_{1}),\dots ,({\vec {x}}_{n},y_{n})\}} with class labels y i Y {\displaystyle y_{i}\in \mathbf {Y} } {\displaystyle y_{i}\in \mathbf {Y} }, compute the per-class centroids μ = 1 | C | i C x i {\displaystyle \textstyle {\vec {\mu }}_{\ell }={\frac {1}{|C_{\ell }|}}{\underset {i\in C_{\ell }}{\sum }}{\vec {x}}_{i}} {\displaystyle \textstyle {\vec {\mu }}_{\ell }={\frac {1}{|C_{\ell }|}}{\underset {i\in C_{\ell }}{\sum }}{\vec {x}}_{i}} where C {\displaystyle C_{\ell }} {\displaystyle C_{\ell }} is the set of indices of samples belonging to class Y {\displaystyle \ell \in \mathbf {Y} } {\displaystyle \ell \in \mathbf {Y} }.

Prediction

[edit ]

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

See also

[edit ]

References

[edit ]
  1. ^ Manning, Christopher; Raghavan, Prabhakar; Schütze, Hinrich (2008). "Vector space classification". Introduction to Information Retrieval. Cambridge University Press.
  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. Bibcode:2002PNAS...99.6567T. doi:10.1073/pnas.082099299 . PMC 124443 . PMID 12011421.

AltStyle によって変換されたページ (->オリジナル) /