1

I'm doing classification using SVM and MLP in WEKA. I have managed to make WEKA produce the result in a csv file. However, I could not understand the prediction results being displayed.

For example, actual result 2:1, predicted result 1:0. Can someone explain what does 2:1 and 1:0 represent? I know they are the actual and predicted result, but I need a further explanation on this values. Thanks

Falady
  • 124
  • 1
  • 15

2 Answers2

2

In 2:1 the 2 is the number of the class in Weka (not something from your data file) and the 1 is the class prediction. Your classes must be 1 and 0.

This is confusing, especially since I can't see this is easily found in the documentation.

It's easier to see this if we load in the contact-lenses file (which comes with Weka). There are 3 classes to be predicted: soft, hard, and none.

So, in the prediction output, we see this

=== Predictions on test data ===

inst#,actual,predicted,error,prediction
1,2:hard,2:hard,,1
2,3:none,3:none,,1
3,1:soft,1:soft,,0.8
1,2:hard,2:hard,,0.6
2,3:none,3:none,,1
3,1:soft,1:soft,,0.8
1,2:hard,3:none,+,1
2,3:none,3:none,,1
3,1:soft,1:soft,,0.8
1,2:hard,2:hard,,0.6
2,3:none,3:none,,1
3,1:soft,1:soft,,0.8
1,3:none,3:none,,1
2,3:none,2:hard,+,0.8
1,3:none,3:none,,1
2,3:none,3:none,,1
1,3:none,3:none,,1
2,3:none,3:none,,1
1,3:none,3:none,,1
2,3:none,3:none,,1
1,3:none,2:hard,+,0.8
2,3:none,1:soft,+,1
1,3:none,3:none,,1
2,1:soft,1:soft,,0.8

It's easy to see that Weka internally is coding soft as 1, hard as 2, and none as 3, 3:none means either an actual or a prediction of the third class, "none".

zbicyclist
  • 691
  • 5
  • 10
0

First question

2,1:soft,1:soft,,0.8

What is the difference between "predicted" and "prediction"? Predicted is soft and prediction is 0.8. What is 0.8? Why is the error blank (,,)?

Answer

  • predicted: this is the label that got predicted
  • prediction: is the probability for the predicted label (0.8)
  • error: is blank as actual and predicted label are the same, ie a correct prediction by the model

Second question

2,3:none,1:soft,+,1

Why is error represented with "+"? Why prediction is 1? Does it mean the prediction is 1. If the prediction is 1, what is 0.6 or 0.8 on your example?

Answer

  • error: the model predicted the label incorrectly (sort) compared to the actual label (none), hence the indicator + that this is an incorrect prediction
  • prediction: the model assigns this prediction a probability of 1 (it doesn't know that it is wrong)

Other values for prediction in the example represent the probability associated with the chosen label.

fracpete
  • 2,448
  • 2
  • 12
  • 17