Meaning of correctly classified instances weka

nadia picture nadia · Sep 3, 2012 · Viewed 10k times · Source

I recently started using weka and I'm trying to classify tweets into positive or negative using Naive Bayes. So I have a training set with tweets that I gave the label for and a test set with tweets that all have the label "positive". When I ran Naive Bayes, I get the following results:

Correctly classified instances: 69 92% Incorrectly classified instances: 6 8%

Then if I change the labels of the tweets in the test set to "negative" and ran again Naive Bayes, the results are inversed:

Correctly classified instances: 6 8% Incorrectly classified instances: 69 92%

I thought that correctly classified instances show the accuracy of Naive Bayes and that it should be the same no matter the labels of the tweets in test set. Is there something wrong with my data or I don't understand correctly the meaning of correctly classified instances?

Thanks a lot for your time,

Nantia

Answer

Antimony picture Antimony · Sep 3, 2012

The labels on the test set are supposed to be the actual correct classification. Performance is computed by asking the classifier to give its best guess about the classification for each instance in the test set. Then the predicted classifications are compared to the actual classifications to determine accuracy. Therefore, if you flip the 'correct' values that you give it, the results will be flipped as well.