I have a training and test ARFF file dataset as such. I had created the below dataset by extracting region-of-interest from a 6 band image and the labels pertaining to each coordinate.
@RELATION agricultural.data
@attribute band0 numeric
@attribute band1 numeric
@attribute band3 numeric
@attribute band4 numeric
@attribute band5 numeric
@attribute band6 numeric
@attribute class {1,2,3,4,5,6,7,8,9}
@data
-10.95659,-7.61896,-9.8674499,-9.118701,-8.620638,-12.699167,5
...
-9.172866,-9.814803,-10.693634,-13.313326,-8.568673,-12.355089,3
Using the above data I have trained the RandomForest and have gotten some results which seem in-line with what I expect.
I have an ARFF file dataset as such. It doesn't have any class attribute
@RELATION agricultural.data.fullimage
@attribute band0 numeric
@attribute band1 numeric
@attribute band3 numeric
@attribute band4 numeric
@attribute band5 numeric
@attribute band6 numeric
@data
-9.261405,-7.302625,-10.753542,-8.018068,-7.776727,-12.878252
...
-9.188496,-10.676176,-14.194083,-9.687324,-9.785445,-12.490084
This is actual image line-by-line generated ARFF file. I want to classify the whole image. It doesn't have any labels. How do I classify the image. (Segmentation?)
FilteredClassifier fc = new FilteredClassifier();
fc.setClassifier(myRandomForestTrainedModel);
for(int pixel=0;pixel < ncols;pixel++) {
double prediction;
/**Some edge case handling**/
prediction = fc.classifyInstance(data.instance(pixel)); //Each data here is a row in the image which I create an ARFF file for
byteLinePrediction[pixel] = (byte)Math.floor(prediction+0.5);
}
There is an exception at the classifyInstance()
function which reads as below:
weka.core.UnassignedClassException: weka.classifiers.meta.FilteredClassifier: Class attribute not set!
But, I don't have classes assigned to these pixels as I don't want to evaluate the performance of the classifier but use the classifier to generate an classified(segmented) image map.