// we tried all the attributes and could not split the data anymore
return new Leaf(data.majorityLabel(rng));
}
// find the best split
Split best = null;
for (int attr : attributes) {
Split split = igSplit.computeSplit(data, attr);
if (best == null || best.getIg() < split.getIg()) {
best = split;
}
}
boolean alreadySelected = selected[best.getAttr()];