updateScores(sampleSet, scores, ensemble, null);
}
public static void updateScores(Sample sampleSet, double[] scores, Ensemble ensemble, LearningProgressListener progressListener) {
for (int t = 0; t < ensemble.getNumTrees(); t++) {
RegressionTree tree = (RegressionTree) ensemble.getTreeAt(t);
double treeWeight = ensemble.getWeightAt(t);
//System.out.println("Using tree " + t + " with weight: " + treeWeight); // SISTA
for (int i = 0; i < sampleSet.size; i++) {
//System.out.println("Classifying datum #" + i + " with index " + sampleSet.indicesInDataset[i]); // SISTA
scores[i] += treeWeight * tree.getOutput(sampleSet.dataset, sampleSet.indicesInDataset[i]);
}
if (progressListener != null) {
progressListener.onScoreEval();
}
}