A regression tree chooses a threshold and constant predictions to minimize the squared-error criterion
where ranges over thresholds producing two nonempty groups. For a fixed split, the least-squares minimizers are the two sample means,
Thus the first split is the candidate threshold with the smallest sum of the two within-node residual sums of squares.
With , it suffices to put the threshold between and for . Form the prefix sums
They take operations to compute. The minimized squared errors for the two children are
and
Each candidate value therefore takes constant time once the prefix sums are available. Scanning all candidates takes operations in the sense of Big O notation, and retaining the minimizing gives the optimal split.
Write
The ordinary least squares estimators give
where
The denominator is positive because the sorted inputs are distinct and .
For each , the displayed objective is the sum of the minimized linear-regression residual sums of squares on the prefix and suffix . Precompute prefix sums of
This requires operations. The corresponding five sums over a suffix are obtained by subtracting a prefix sum from the total.
For any block of observations, these raw sums give in constant time
By the formula for the residual sum of squares in simple linear regression, its minimized loss is
Hence both losses for a proposed take constant time. Evaluating their sum for and keeping the minimum is another scan, so the complete minimization uses computations.

Articles by others on the same topic (0)

There are currently no matching articles.