k-Nearest Neighbors (k-NN) Classification - Intro
- Home
- k-Nearest Neighbors (k-NN) Classification - Intro
k-Nearest Neighbors (k-NN) Classification - Intro
In k-Nearest Neighbor classification, the training dataset is used to classify each member of a "target" dataset. The structure of the data is that there is a classification (categorical) variable of interest ("buyer," or "non-buyer," for example), and a number of additional predictor variables (age, income, location...). Generally speaking, the algorithm is as follows:
- For each row (case) in the target dataset (the set to be classified), locate the k closest members (the k nearest neighbors) of the training dataset. A Euclidean Distance measure is used to calculate how close each member of the training set is to the target row that is being examined.
- Examine the k nearest neighbors - which classification (category) do most of them belong to? Assign this category to the row being examined.
- Repeat this procedure for the remaining rows (cases) in the target set.
- Additional to this XLMiner also lets the user select a maximum value for k, builds models parallelly on all values of k upto the maximum specified value and scoring is done on the best of these models.
Of course the computing time goes up as k goes up, but the advantage is that higher values of k provide smoothing that reduces vulnerability to noise in the training data. In practical applications, typically, k is in units or tens rather than in hundreds or thousands.
We're Here to Help
- Question or Comment
- Support Live Chat
- Consulting Help
- Support KnowledgeBase
-
Call Us
Inside USA: 888-831-0333
Outside: 01+775-831-0300
