I am using the Java API of Weka to apply a Naive Bayes classification to an .arff file I've created. The (@data part) file has the following format:
0 0 0 0 1 0 ... 0
1 0 0 0 0 1 ... 0
.
.
.
0 0 1 0 0 1 ... 3
.
.
.
0 0 0 0 1 0 ... 5
Where each number belongs to [0,1], except the last one which is the class [0,5].
Considering that I am using a 10-split cross validation, would it be a mistake to have my data in a sorted by class form? Would that lead in taking the test data from the last class only for example?
I am getting the following confusion matrix, which is obviously wrong:
0.0 |0.0 |0.0 |0.0 |0.0 |0.0|
0.0 |0.0 |0.0 |0.0 |0.0 |0.0|
0.0 |0.0 |0.0 |0.0 |0.0 |0.0|
0.0 |0.0 |0.0 |0.0 |0.0 |0.0|
42.0|14.0|15.0|114.0|233.0|7.0|
71.0|16.0|30.0|241.0|86.0 |7.0|
Any ideas why the first 4 classes are only zeroes? My .arff file has examples (not so evenly distributed) from all 6 classes.
EDIT: I shuffled my data and now I am getting a much more rational result.
27.0|2.0|8.0 |24.0 |27.0 |2.0|
4.0 |2.0|0.0 |2.0 |1.0 |0.0|
6.0 |3.0|15.0|16.0 |19.0 |3.0|
29.0|4.0|13.0|326.0|87.0 |33.0|
20.0|5.0|7.0 |37.0 |110.0|6.0|
5.0 |0.0|1.0 |17.0 |8.0 |7.0|
I am using the code I found here. Is there anything wrong with it?