Skip to content
LearnStatisticspowered by UpThink

Statistics and data science, defined

k-Nearest Neighbors Prediction

The k-nearest neighbors (k-NN) prediction is a method to predict a value of a target variable in a given record, using as a reference point a training set of similar objects. The basic idea is to choose k objects from the training set that are closest to the given object in terms of the predictor variables, then to form the weighted average of target variable for those k objects. The weights are usually chosen inversely proportionally to the distances from the target object.

Related entries

Where this gets used

We teach data science and statistics online, one subject at a time, on fixed start dates with an instructor who marks your work.