Maybe wrong values for precision and recall
-
29-11-2019 - |
Question
I'm trying to do some data mining with RapidMiner studio. I've applied the K-nearest neighbor algorithm with different values of K. As I expected, accuracy increase and after K=5, it decrease. But I cannot understand why value of recall for Basic increase (as I expected) but recall for Premium decrease. The same for values of precision.
Below my results: Basic and Premium are the values of my class label
With K=5
True Basic Class recall: 91.83% Class precision: 81.18%
True Premium Class recall: 32.87% Class precision: 56.07%
With K=2
True Basic Class recall: 81.99% Class precision: 82.94%
True Premium Class recall: 32.87% Class precision: 45.20%
Solution
If you are calling a higher proportion of cases as Basic with K=5, then this will probably lower your Basic precision, increase your Basic recall, increase your Premium precision, and lower your Premium recall. This is because there is always a tradeoff between precision and recall, and Basic and Premium are opposites in your binary classifier.