private PredictionMap getPredictionForNClasses(AttributesMap attributes) {
PredictionMap sumsByClassification = new PredictionMap(new HashMap<Serializable, Double>());
for (Tree tree : trees) {
final PredictionMap treeProbs = tree.predict(attributes);
for (Map.Entry<Serializable, Double> tpe : treeProbs.entrySet()) {
Double sum = sumsByClassification.get(tpe.getKey());
if (sum == null) sum = 0.0;
sum += tpe.getValue();
sumsByClassification.put(tpe.getKey(), sum);
}