I have the following sparse ARFF File in Weka – I want to build a classifier from the given sparse ARFF file (training dataset) using a Weka Java API. The program is reading the file [not throwing any Exception] but not able to read the instances. When I print the number of instances – the program prints as 0. Thanks in advance for inputs.
@RELATION ample
@ATTRIBUTE T1 numeric
@ATTRIBUTE T2 numeric
@ATTRIBUTE T3 numeric
@ATTRIBUTE T4 numeric
@ATTRIBUTE T5 numeric
@ATTRIBUTE C1 {0, 1}
@DATA
{0 3, 1 2, 2 1, 6 1}
{3 3, 4 2, 6 0}
ArffLoader loader = new ArffLoader();
loader.setFile(new File("C:\\SAMPLE-01.arff"));
Instances data = loader.getStructure();
data.setClassIndex(data.numAttributes() - 1);
System.out.println("Number of Attributes : " + data.numAttributes());
System.out.println("Number of Instances : " + data.numInstances());