Skip to main content

Module trees

Module trees 

Source
Expand description

Tree-based methods (ISL ch 8) — CART trees and their ensembles.

  • decision_tree — CART regression (MSE) / classification (Gini) tree.

Random forest (bagging + feature subsampling) and gradient boosting build on the same tree and land next (build order in stats_plan.md).

Re-exports§

pub use bart::Bart;
pub use boosting::GradientBoosting;
pub use decision_tree::Criterion;
pub use decision_tree::DecisionTree;
pub use decision_tree::TreeParams;
pub use random_forest::RandomForest;

Modules§

bart
Bayesian Additive Regression Trees (ISL ch 8.2.4, Chipman-George-McCulloch 2010) — a sum-of-trees regression model y = Σⱼ gⱼ(x) + ε fit by Bayesian backfitting MCMC: each tree is updated in turn against the partial residual via a grow/prune Metropolis-Hastings step with conjugate-normal leaves, and the noise variance is drawn from its inverse-gamma full conditional.
boosting
Gradient boosting for regression (ISL ch 8.2.3) — fit an additive ensemble of shallow CART trees, each trained on the residuals of the running prediction under squared-error loss (so the negative gradient is the residual). Predictions are init + ν·Σ treeₘ(x) with learning rate ν. Built on super::decision_tree.
decision_tree
CART decision trees (ISL ch 8.1) — recursive binary splitting for regression (variance / MSE reduction) and classification (Gini impurity), over a row-major feature matrix. The arena-based node store avoids deep Box recursion. The same builder powers random forests and gradient boosting (with feature subsampling / shallow depth). Scalar split search → CPU.
random_forest
Random forests (ISL ch 8.2.1–8.2.2) — bagging an ensemble of CART trees, each grown on a bootstrap resample with a random feature subset per split (decorrelating the trees). Regression averages the trees; classification takes a majority vote. Built on super::decision_tree (no duplicated tree logic).