KNN - Understanding K Nearest Neighbor Algorithm in Python
K Nearest Neighbors is a very simple and intuitive supervised learning algorithm. A supervised learning algorithm is one in which you already know the result you want to find. It works like this you give your model a dataset having data and results, using the data your model creates a decision boundary to predict the desired result. It is a really intuitive and simple algorithm and it can be used both as classifier and as regressor. I will not give you a standardized definition of classification and regressor as it might confuse you let’s understand with an example: Given a dataset of features of cat and dog your job is to tell by examining the features that given animal is cat or dog this is a classification problem while you are given a dataset of houses having various features and price of houses on examining the data you have to predict the price of a house given to you as query this is a regression problem here you are not classifying you are predicting a value. Now first we will ...