Advantages and Disadvantages of KNN Algorithm

Advantages of KNN Algorithm

1. Knn is simple to implement.

2. Knn executes quickly for small training data sets.

3. Performance asymptotically approaches the performance of the Bayes Classifier.

4. Don’t need any prior knowledge about the structure of data in the training set.

5. No retaining is required if the new training pattern is added to the existing training set.

Disadvantages of KNN Algorithm

1. When the training set is large, it may take a lot of space.

2. For every test data, the distance should be computed between the test and all the training data. Thus a lot of time may be needed for the testing.

3. Knn can have poor run-time performance when the training set is large. It is very sensitive to irrelevant or redundant features because all features contribute to the similarity and thus to the classification. By careful feature selection or feature weighting, this can be avoided. \

4. Distance-based learning isn’t clear which type of distance to use and which attribute to use to produce the best results.

5. Computation cost is quite high because we need to compute the distance of each query instance to all training samples.