Implementing a machine learning algorithm on your own can give better understanding about how the thing works under the hood. This also helps in understanding the mathematical implementations and gives a better overview of the application of different concepts.

In this post I will be talking about implementation of k Nearest Neighbor classifier which is one of the simplest but very effective algorithm in Machine Learning. kNN can classify a new point by examining the class of its nearest neighbors. eg: If there is an area where majority of people residing are from different economic classes like high income , middle income and low income group. So given a new data point this algorithm can classify the person lies in which of the income group based on its nearest neighbors. Under the hood this algorithm uses distance metrics which can be euclidean distance , cosine similarity , taxi cab or Manhattan distance etc.

Below is the link , any feed back is appreciated.