Question

I have implemented the KNN classifier in java and I got a strange result. If I do a sentiment analysis on a dataset example amazon books review I got 55% precision. From 100 test document 55 correctly classified as negative or positive review and 45 incorrectly. But If I use the KNN for category classification example camera or books then I got 95% precision.

There are some explanation my code is wrong? Any idea?

Was it helpful?

Solution

@Christopher Pfohl is right. They are different approaches with one key difference for you. Sentiment analysis (based on simple Bag of Words) is much more complicated, in general, than category classification in your case.

Btw, just one clarification, 55% is not precision, that is accuracy. (More info: http://en.wikipedia.org/wiki/Accuracy_and_precision#In_binary_classification)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top