// get instance id corresponding to this line
long instanceId = instanceIds.size() > nLine ? instanceIds
.get(nLine) : nLine;
nLine++;
// allocate instanceEval
ClassifierInstanceEvaluation instanceEval = new ClassifierInstanceEvaluation();
// parse out predicted class from output predictions
String predictTokens[] = wsPattern.split(predictionLine);
String classIdPredicted = predictTokens[0];
String classIdTarget = extractFirstToken(instanceLine,
wsPattern);
// parse out target class from input data file
instanceEval.setTargetClassId(Integer.parseInt(classIdTarget));
instanceEval.setPredictedClassId(Integer
.parseInt(classIdPredicted));
instanceEval.setInstanceId(instanceId);
instanceEval.setClassifierEvaluation(eval);
// add the instance to the map
eval.getClassifierInstanceEvaluations().put(instanceId,
instanceEval);
// parse class id probabilities
if (storeProbabilities && predictTokens.length > 1) {
for (int i = 1; i < predictTokens.length; i++) {
instanceEval.getClassifierInstanceProbabilities().put(
classIds.get(i - 1),
Double.parseDouble(predictTokens[i]));
}
}
}