KNN is a kind of voting algorithm that calculating distance with every instance then choose the K nearest neighbors. Then according to the majority of these K examples, assign the unknown data with this major classification.
Euclidian Distance:
Coding by Machine Learning in Action
KNN.py
#-*-coding:utf-8-*-
from numpy import *
import operator
def createDataSet():
group = array([[