Tree-Based Model
A tree-based model splits the feature space into regions and assigns predictions inside each region. Decision trees, random forests, and gradient-boosted trees belong to this family.
At a split, the model chooses a feature and threshold that reduce impurity or loss:
Here is a feature index, is a threshold, and is the impurity reduction or loss improvement from the split.
For classification, one common impurity measure is Gini impurity:
where is the class fraction in node sample set .
For regression, a split often minimizes squared error inside child nodes:
where is the mean target in child node .
Strengths
- Handles nonlinear feature interactions.
- Works well on tabular data.
- Requires less feature scaling than many linear or kernel methods.
- Captures threshold effects and feature interactions without explicit feature crosses.
Prediction Form
A regression tree partitions feature space into leaves and predicts a constant in each leaf:
For classification, each leaf stores class probabilities:
where is the training set that lands in the same leaf as .
Tree Ensembles
Most strong tree-based systems are ensembles.
| Model | Main mechanism | Good for |
|---|---|---|
| decision tree | one recursive partition | interpretability and simple baselines |
| random forest | bagged trees with feature randomness | robust tabular baseline |
| gradient boosting | additive trees fit to residual/gradient signal | high-performance tabular prediction |
| calibrated tree ensemble | post-hoc probability calibration | reliable probabilities |
Gradient boosting builds:
where is the next tree and is the learning rate.
Tabular Boundary
Tree models are often strong on structured tabular data, but less natural for raw images, sequences, graphs, or coordinates unless features are engineered first.
| Input | Tree model requirement |
|---|---|
| tabular descriptors | usually direct |
| molecules | needs fingerprints/descriptors |
| proteins | needs sequence/structure features |
| images | needs extracted features or embeddings |
| text | needs sparse features or embeddings |
Limits
- Single trees can overfit.
- Extrapolation outside the observed feature range is weak.
- Large ensembles can be harder to interpret than a single tree.
- Split decisions can be unstable when correlated features provide similar signals.
- Probabilities from leaves or ensembles may need calibration.
- Missing values and categorical variables need explicit handling.
Regularization Knobs
- Maximum depth.
- Minimum samples per leaf.
- Minimum impurity decrease.
- Number of leaves.
- Pruning.
- Learning rate and number of trees for boosting.
- Feature subsampling and row subsampling for ensembles.
Checks
- Are features available at deployment exactly as during training?
- Is the evaluation split grouped to prevent leakage through near-duplicate rows?
- Are categorical and missing values handled consistently?
- Does the tree ensemble extrapolate poorly outside the observed feature range?
- Are probability outputs calibrated if used for decisions?