PiLab-CAU / ComputerVision-2401

Computer Vision Course 2024-01
Apache License 2.0
9 stars 3 forks source link

[lecture9][0521] KNN, an equal number of samples for each class label #29

Closed jeonghyunpark2002 closed 1 day ago

jeonghyunpark2002 commented 1 month ago

Hi, professor! I have a question about K-nearest neigbor classifier.

vision

When k = 4, the number of blue label and red label sample is same, as 2.

Then, what is the output of this classifier? Or, how we classify in this case? Is there any additional criteria to determine?

Thank you!

yjyoo3312 commented 1 month ago

@jeonghyunpark2002

Thank you for raising that good point! In this case, determining the output results can be very challenging. To avoid this issue, we typically choose an odd number for K, such as 1, 3, or 5.

jeonghyunpark2002 commented 1 month ago

@yjyoo3312

Thank you for fast response and a tip to resolve this issue!