This is generally called as k Nearest Neighbourhood (kNN) method. This classification mainly works on the maxim “birds of a feather flock together”. That is things that are alike have features (properties) that are alike. We use this idea in nearest neighbour classification and place a new data with the class (category) having similar features or nearest neighbour.
We just classify the unlabelled class of new data to the class which is nearest. Even the idea of classification is simple, they are extremely powerful and can be used for
1) Predicting a person likes a movie or not
2) Predicting whether a person is a nationalist or communist (in INDIA)
3) Checking whether a tumour is malignant or not.
When to choose kNN method:
We use this method when the relationship between the features and the target class is complicated or extremely difficult to understand. Or when we are dealing BIG DATA AND HIGH DIMENSIONAL DATA where its extremely difficult to understand the relationships. Or when the relations are difficult to express but can be visualized.
When there is no clear distinction between the groups(classes) this method is not recommended.
The kNN Algorithm:
Usually we have two data sets one is training data set and other is test data set. In training data set we will be having the class group of each data point. We have to classify each data point of test data set. For each data point of test data set we look at the ‘k’ nearest neighbours in the training data set and classify it to the majority class. Note that here k is prefixed before classification.
In the next post we shall see how to choose ‘k’ value.
0 comments:
Post a Comment