Why are probability estimates from raw KNN votes frequently poorly calibrated?

Quick Overview

Asks why the class probabilities a k-nearest neighbors model reports from neighbor votes are often poorly calibrated. Tests understanding of how vote fractions behave as probability estimates, what distorts them, and how to improve and measure calibration on held-out data.

Why are probability estimates from raw KNN votes frequently poorly calibrated?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why are probability estimates from raw KNN votes frequently poorly calibrated? ```hint Count the possible outputs With uniform voting over k neighbors, list the values the predicted probability can take, and think about what happens on a mistake when k is small. ``` ```hint Ask what is being fit Compare how KNN produces its score with how logistic regression produces one. Which of the two is trained to minimize a loss on probabilities? ``` ### What a Strong Answer Covers - What kind of probability estimate a vote fraction is - How the choice of k changes the direction of miscalibration and the log-loss - How local density, neighbor distance, class imbalance and high dimensionality distort the votes - Ways to improve the raw scores and to calibrate them on held-out data - How calibration is measured ### Follow-up Questions - Does increasing k always improve calibration? What happens as k approaches the size of the training set? - You calibrate a k=5 model with isotonic regression. How many distinct probabilities can the calibrated model output, and why? - When would you choose Platt scaling over isotonic regression for a KNN model? - How would you check calibration for a rare class specifically?

Overview: Asks why the class probabilities a k-nearest neighbors model reports from neighbor votes are often poorly calibrated. Tests understanding of how vote fractions behave as probability estimates, what distorts them, and how to improve and measure calibration on held-out data.

Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

Why are probability estimates from raw KNN votes frequently poorly calibrated?

What a Strong Answer Covers Guidance

  • What kind of probability estimate a vote fraction is
  • How the choice of k changes the direction of miscalibration and the log-loss
  • How local density, neighbor distance, class imbalance and high dimensionality distort the votes
  • Ways to improve the raw scores and to calibrate them on held-out data
  • How calibration is measured

Follow-up Questions Guidance

  • Does increasing k always improve calibration? What happens as k approaches the size of the training set?
  • You calibrate a k=5 model with isotonic regression. How many distinct probabilities can the calibrated model output, and why?
  • When would you choose Platt scaling over isotonic regression for a KNN model?
  • How would you check calibration for a rare class specifically?