1
$\begingroup$

I'm doing a binary classification using K-nearest neighbor method. However when I look at the training data, 80% of the data is from category 2, and only 20% is from category 1.

Is it bad when you try to learn from that data? I feel like most of the prediction go to category 2.

$\endgroup$
1
  • $\begingroup$ Please make your title a little more detailed $\endgroup$ Commented Mar 1, 2013 at 18:10

1 Answer 1

1
$\begingroup$

Good or bad depends on your criterion.

Assuming your samples aren't biased, that is your out-of-sample has similar 80% C2 and 20% C1. (If not, then you should consider improve your data.) If your goal is to minimise the misclassification error, then predicting everything is category 2 isn't bad at all -- 80% success rate. This gives highest P1 = P(predict C1|true C1) = 1 and lowest P2 = P(predict C2|true C2) = 0

However, you can assign different weights to different categories if you want. So you do a weighted vote instead of a simple majority vote in you K neighbours for prediction. This would increase your performance on P2 with sacrifice on P1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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