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.

Uses your system voice; voice and rate in settings.

≈ 2 min read

Cite, export and learn8 citation formats · 8 exports · lesson and quiz

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

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 edit source

Training

edit edit source

Given labeled training samples {(x→1,y1),…,(x→n,yn)} with class labels yi∈𝐘, compute the per-class centroids μ→ℓ=1|Cℓ|∑i∈Cℓx→i where Cℓ is the set of indices of samples belonging to class ℓ∈𝐘.

Prediction

edit edit source

The class assigned to an observation x→ is ŷ=arg⁡minℓ∈𝐘‖μ→ℓ−x→‖.

See also

edit edit source

References

edit edit source
  1. ^ Manning, Christopher; Raghavan, Prabhakar; Schütze, Hinrich (2008). "Vector space classification". Introduction to Information Retrieval. Cambridge University Press. Wikipedia revision 1329283882, retrieved 2026-11-18
  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. Wikipedia revision 1329283882, retrieved 2026-11-18

Text derived from https://en.wikipedia.org/w/index.php?oldid=1329283882 under CC BY-SA 4.0; modifications have been made.

Words in each sectionAlgorithmAlgorithmAlgorithm: 61 words61See alsoSee alsoSee also: 15 words15
Words in each section. Measured from the stored article body; sections below the minimum are not plotted.

Provenance

snapshot enwiki-001329283882 · captured 2025-12-24 · ledger · version history

Cite this page as: encyclopegia.org, “Nearest centroid classifier”, snapshot enwiki-001329283882. https://encyclopegia.org/a/nearest-centroid-classifier