Algorithm 2.
t = buildExtraTree(X, Y)
| if |X| < nmin OR isConstant(Y) then |
| Return buildLeaf(mean(Y)) |
| end if |
| // Generate Candidate Thresholds at Random |
| {λ1, …, λn} ← GenerateSplits(min(X(j)),max(X(j))), ∀j ∈ {1, …, s} |
| // Select Threshold with Best Score (Eq. (4)) |
| // Split Data, Recurse, and Build node |
| {Xl, Yl, Xr, Yr} ← λj(X, Y) |
| tl ← buildExtraTree(Xl, Yl) |
| tr ← buildExtraTree(Xr, Yr) |
| Return buildNode(λj, j, tl, tr) |