I am reading notes on using weights for KNN and I came across an example that I don't really understand.
Suppose we have K = 7 and we obtain the following:
Decision set = {A, A, A, A, B, B, B}
If this was the standard KNN algorithm we would pick A, however the notes give an example of using weights:
By class distribution (weight inversely proportional to class frequency)
class A: 95 %, class B 5 %
This results in a class of B.
I can't seem to figure out the math that was left out to obtain B as the answer.