Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding out wrongly classified instances when using WEKA

Tags:

weka

I am using GUI version of WEKA and I am classifying using the Naive Bayes. Can anyone please let me know how to find out which instances are misclassified.

like image 831
user1402432 Avatar asked May 18 '12 04:05

user1402432


People also ask

What is incorrectly classified instances in Weka?

Similarly, incorrectly classified instances means the sum of FP and FN. The total number of correctly instances divided by total number of instances gives the accuracy. In weka, % of correctly classified instances give the accuracy of the model.

How do I know my Weka instance?

In WEKA GUI go to Explorer, open your ARFF file and then go to Classify-->More options-->Output predictions-->Choose. There choose a format to see the classifications for your test set. Try first with PlainText, WEKA will output the predictions for each of the test instances.

How do you calculate precision and accuracy in Weka?

Accuracy is calculated as the total of two correct predictions (TP + TN) divided by the total number of data sets (P + N). The best accuracy is 1.0 and the worst is 0.0. Sensitivity is calculated as the number of correct positive predictions (TP) divided by the total number of positive (P).

How do you use Weka classification?

Setting Test DataUnder cross-validation, you can set the number of folds in which entire data would be split and used during each iteration of training. In the percentage split, you will split the data between training and testing using the set split percentage. Next, you will select the classifier.


2 Answers

  1. Go to classify tab in Weka explorer
  2. Click more options...
  3. Check output predictions
  4. Click OK

Hope that helps.

like image 114
Rushdi Shams Avatar answered Sep 28 '22 08:09

Rushdi Shams


I faced this very same problem earlier and I tackle it just fine now. What I do, is the following:

  1. Make one String attribute that assigns each instance a unique ID. I have assigned the names of the documents to each of my instances.
  2. Generate the WEKA supported .arff file.
  3. Whenever you have to run a classifier on this .arff data, you will notice that you have to exclude the Instance ID attribute. If you don't do this, Weka will pop-up an error saying that the classifier cannot process String attributes. Instead of excluding, run filter StringToNominal on the InstanceID.
  4. Now, as said by @Rushdi, click "More Options" on the classify tab.
  5. Check Output predictions on the "Classifier Evaluation Options" pop-up.
  6. Enter the Attribute number of the Instance ID in the "Output additional attributes" box.
  7. Run the classifier on the whole data, excluding the Instance ID attribute. (Most classifiers have this as an option called "StartSet" in "Ranker" for example which I use along with SMO classifier.)
  8. If you've done everything properly so far, you will see all the instances listed along with their real and predicted output values and also the Instance ID which can tell you exactly which documents were incorrectly classified.

Hope this helps someone. Good Luck!

like image 22
Menezes Sousa Avatar answered Sep 28 '22 08:09

Menezes Sousa