Content deleted Content added
m Reverted edits by 5.112.116.64 (talk) to last version by Pirehelokan |
No edit summary Tag: Reverted |
||
Line 18:
Suppose we have pairs <math>(X_1,Y_1), (X_2,Y_2), \dots, (X_n, Y_n) </math> taking values in <math>\mathbb{R}^d \times \{1,2\}</math>, where {{mvar|Y}} is the class label of {{mvar|X}}, so that <math>X|Y=r \sim P_r</math> for <math>r=1,2</math> (and probability distributions <math>P_r</math>). Given some norm <math>\|\cdot\|</math> on <math>\mathbb{R}^d</math> and a point <math>x \in \mathbb{R}^d</math>, let <math>(X_{(1)},Y_{(1)}), \dots, (X_{(n)}, Y_{(n)}) </math> be a reordering of the training data such that <math> \|X_{(1)}-x\| \leq \dots \leq \|X_{(n)}-x\| </math>.
==Algorithm== hello there
[[File:KnnClassification.svg|thumb|right|Example of ''k''-NN classification. The test sample (green dot) should be classified either to blue squares or to red triangles.
|