if (!(model instanceof PMMLClassifier)) {
throw new Exception("PMML model is not a classifier!");
}
double[] preds = null;
PMMLClassifier classifier = (PMMLClassifier)model;
for (int i = 0; i < test.numInstances(); i++) {
buff.append("Actual: ");
Instance temp = test.instance(i);
if (temp.classAttribute().isNumeric()) {
buff.append(temp.value(temp.classIndex()) + " ");
} else {
buff.append(temp.classAttribute().value((int)temp.value(temp.classIndex())) + " ");
}
preds = classifier.distributionForInstance(temp);
buff.append(" Predicted: ");
for (int j = 0; j < preds.length; j++) {
buff.append("" + preds[j] + " ");
}
buff.append("\n");