"n_neighbors" is not a multiple of "n_classes" in KNNE
jayahm opened this issue · 2 comments
jayahm commented
Hi
I got this warning when using KNNE:
Line 243 in 6ae0f5a
warnings.warn('"n_neighbors" is not a multiple of "n_classes". Got'
'{} and {}.One or more classes will have one less'
' instance.'.format(n_neighbors,
self.n_classes_))
I understood that n_neighbors
requires a multiply of a number of classes. But, for example, if I set n_neighbors =7
for binary classification of two classes, does it mean the final n_neighbors
will be 6?
How about n_neighbors = 11
but with 3 classes? The final n_neighbors
is 3 for each class?
Menelau commented
@jayahm Hello,
the n_neighbors is still 7, however, the number of neighbors will be 4 belonging to one class and 3 belonging to the other (one class having more neighbors than the other).
jayahm commented
I see. Thanks.