Is KNN a supervised or an unsupervised algorithm?

Quick Overview

Asks whether k-nearest neighbors is a supervised or an unsupervised method and why. It tests how KNN makes its predictions, the common mix-up with K-Means, and how nearest-neighbor search is used in tasks that have no labels.

Is KNN a supervised or an unsupervised algorithm?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

Is KNN a supervised or an unsupervised algorithm? ```hint Look at the prediction step Ask what KNN needs from each neighbor in order to produce a prediction for a new point. ``` ### What a Strong Answer Covers - The classification, with the reason tied to how predictions are made - How KNN's lack of a training phase relates to the question - The common confusion with K-Means - How nearest-neighbor search is used when there are no labels ### Follow-up Questions - KNN has no real training step. Does that make it any less supervised? - How would you use k-nearest-neighbor distances to flag anomalies in unlabeled data? - How does label propagation over a kNN graph combine a few labels with many unlabeled points? - What does K mean in KNN and in K-Means, and how would you choose each?

Overview: Asks whether k-nearest neighbors is a supervised or an unsupervised method and why. It tests how KNN makes its predictions, the common mix-up with K-Means, and how nearest-neighbor search is used in tasks that have no labels.

PracHub logo
General
Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

Is KNN a supervised or an unsupervised algorithm?

What a Strong Answer Covers Guidance

  • The classification, with the reason tied to how predictions are made
  • How KNN's lack of a training phase relates to the question
  • The common confusion with K-Means
  • How nearest-neighbor search is used when there are no labels

Follow-up Questions Guidance

  • KNN has no real training step. Does that make it any less supervised?
  • How would you use k-nearest-neighbor distances to flag anomalies in unlabeled data?
  • How does label propagation over a kNN graph combine a few labels with many unlabeled points?
  • What does K mean in KNN and in K-Means, and how would you choose each?