= Solution
Start with the root region $\mathbb R^p$. For any current terminal region $R$, coordinate $k$, and threshold $s$, form
$$
R_-=\{x\in R:x_k\leq s\},\qquad
R_+=\{x\in R:x_k>s\},
$$
discarding splits that leave an empty child. For each child use its training-response mean
$$
\widehat\gamma_\pm=
\frac{\sum_iY_i'\mathbf1_{R_\pm}(X_i')}
{\sum_i\mathbf1_{R_\pm}(X_i')}.
$$
Compare candidate splits by the resulting residual sum of squares
$$
\sum_{X_i'\in R_-}(Y_i'-\widehat\gamma_-)^2+
\sum_{X_i'\in R_+}(Y_i'-\widehat\gamma_+)^2,
$$
together with the unchanged residual sums in the other leaves. Choose the leaf, coordinate, and threshold minimizing the total. Replace that leaf by its two children and repeat until the stopping rule or the prescribed $J$ leaves is reached. The resulting terminal regions are $\widehat R_1,\ldots,\widehat R_J$, and
$$
\widehat\gamma_j=
\frac{\sum_iY_i'\mathbf1_{\widehat R_j}(X_i')}
{\sum_i\mathbf1_{\widehat R_j}(X_i')}.
$$
This is the standard <regression tree> construction.
Back to article page