K Nearest-Neighbor Algorithm

后端 未结 5 806
春和景丽
春和景丽 2021-01-31 04:28

Maybe I\'m rather stupid but I just can\'t find a satisfying answer: Using the KNN-algorithm, say k=5. Now I try to classify an unknown object by getting its 5 nearest neighbour

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-31 04:57

    Another and interesting option is to use the nearest neighbor like this:

    • You calculate the distances of the 5 nearest neighbors from each class to the sample: you will have 5 distances from each class.

    • Then you get the mean distance for each class.

    • That lower mean distance will be the class you will assign to the sample.

    This way is effective for datasets of classes that overlap.

提交回复
热议问题