Skip to contents

$$\Delta = Var(t) - (n_L/n)Var(t_L) - (n_R/n)Var(t_R)$$ with population variances – the CART impurity decrease. MVSML (2022) sec. 15.4.1 p.642 prints the same criterion in its weighted sum-of-squares form, \(SSE_L\Omega_L + SSE_R\Omega_R\), which is returned alongside: the two rank splits identically but are not the same number.

Usage

Varrd(y, split_idx)

Arguments

y

Responses at the node.

split_idx

Logical mask or integer positions of the left child.

Value

Named list with estimate, delta_var, sse_weighted, sse_left, sse_right, var_parent, var_left, var_right, n_left, n_right, omega_left, omega_right, method.

References

MVSML (2022) sec. 15.4.1 pp.641-642; Breiman et al. (1984) ch.8.4.

Examples

Varrd(c(1, 2, 3, 10, 11, 12), c(TRUE, TRUE, TRUE, FALSE, FALSE, FALSE))
#> $estimate
#> [1] 20.25
#> 
#> $delta_var
#> [1] 20.25
#> 
#> $sse_weighted
#> [1] 2
#> 
#> $sse_left
#> [1] 2
#> 
#> $sse_right
#> [1] 2
#> 
#> $var_parent
#> [1] 20.91667
#> 
#> $var_left
#> [1] 0.6666667
#> 
#> $var_right
#> [1] 0.6666667
#> 
#> $n_left
#> [1] 3
#> 
#> $n_right
#> [1] 3
#> 
#> $omega_left
#> [1] 0.5
#> 
#> $omega_right
#> [1] 0.5
#> 
#> $method
#> [1] "variance reduction split (MVSML 2022 sec. 15.4.1)"
#>