double oobOne = ErrorEstimate.errorRate(trainLabels, errorOne.computePredictions(rng)); // oob error estimate when m = 1
// compute the test set error (Selection Error), and mean tree error (One Tree Error),
// using the lowest oob error forest
ForestPredictions testError = new ForestPredictions(dataSize, nblabels); // test set error
MeanTreeCollector treeError = new MeanTreeCollector(train, nbtrees); // mean tree error
// compute the test set error using m=1 (Single Input Error)
errorOne = new ForestPredictions(dataSize, nblabels);
if (oobM < oobOne) {
forestM.classify(test, new MultiCallback(testError, treeError));
forestOne.classify(test, errorOne);
} else {
forestOne.classify(test,
new MultiCallback(testError, treeError, errorOne));
}
sumTestErr += ErrorEstimate.errorRate(testLabels, testError.computePredictions(rng));
sumOneErr += ErrorEstimate.errorRate(testLabels, errorOne.computePredictions(rng));
sumTreeErr += treeError.meanTreeError();
}