I am trying to use the ZeroR algorithm in Weka in order to make baseline performance for my classification problem. However, Weka is displaying weird results for precision and F-measure, it is showing a question mark '?' instead of any number. Anyone knows how can I fix this ?
=== Classifier model (full training set) ===
ZeroR predicts class value: label 1
Time taken to build model: 0 seconds
=== Stratified cross-validation ===
=== Summary ===
Correctly Classified Instances 431 53.607 %
Incorrectly Classified Instances 373 46.393 %
Kappa statistic 0
Mean absolute error 0.4974
Root mean squared error 0.4987
Relative absolute error 100 %
Root relative squared error 100 %
Total Number of Instances 804
=== Detailed Accuracy By Class ===
TP Rate FP Rate Precision Recall F-Measure MCC ROC Area PRC Area Class
0.000 0.000 ? 0.000 ? ? 0.488 0.457 label 0
1.000 1.000 0.536 1.000 0.698 ? 0.488 0.530 label 1
Weighted Avg. 0.536 0.536 ? 0.536 ? ? 0.488 0.496
=== Confusion Matrix ===
a b <-- classified as
0 373 | a = label 0
0 431 | b = label 1
It's not wrong. Note that you have no cases classified as "a", so the precision (etc.) are indeterminable for "a". Evidently Weka propagates incalculatable values (like Excel does), so the overall precision isn't calculated, either.
Your real problem here is that you have a model that is classifying everything as "b", which is unlikely to be useful. But that's ZeroR, so that's just your starting point.