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%

  • $\begingroup$ Hi, welcome to Data Science StackExchange. Please avoid posting images when possible. In this case, could you please edit your question to include the relevant information in the text? $\endgroup$ – Romain Reboulleau Nov 12 '19 at 19:34
  • $\begingroup$ Sorry, I've edited my question $\endgroup$ – Lorenzoi Nov 12 '19 at 20:46

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.

| improve this answer | |
  • $\begingroup$ Thank you! I got it! $\endgroup$ – Lorenzoi Nov 14 '19 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.