What is the nearest centroid (Rocchio) classifier and when is it useful?
easyAnswer
- Compute the mean feature vector per class; classify a new point as the class whose centroid is closest (usually Euclidean or cosine).
- Extremely simple, no hyperparameters, very fast, no training beyond averaging.
- Works well when classes are roughly spherical and well-separated in feature space.
- Good baseline for text classification with TF-IDF (called Rocchio's method).
- Fails when class distributions are non-spherical or overlapping.
Check yourself — multiple choice
- It's the same as KNN with k=1
- It classifies by nearest class centroid — cheap, hyperparameter-free baseline
- It requires a covariance matrix
- It's specific to image data
Nearest centroid = classify by closest class mean. Rocchio's method for text.
#knn#classification
Practise Supervised Learning
215 interview questions in this topic.
Related questions
- Precision vs recall — when do you optimize each?
- Why is logistic regression called a linear model if it uses a sigmoid?
- Generative vs discriminative classifier — what's the difference?
- How do you read a confusion matrix and derive the key metrics?
- Why do we use cross-entropy (log loss) instead of MSE for classification?
- One-vs-Rest, One-vs-One, and softmax — how do you choose for multi-class?