Model complexity is a model’s capacity to fit increasingly detailed patterns. More complexity often lowers training error, but it does not guarantee better predictions on unseen data. The useful target is a balance: models that are too simple underfit, while models that are too complex can overfit. section 1.3 section 1.3.2
Complexity is expressed through model-specific controls. In a decision tree, greater maximum depth creates more partitions and increases representational power. In support vector regression, a larger C prioritizes training fit over regularization, allowing more complex behavior. These settings should be judged with both training and test scores, not training score alone. section 1.3.1 section 1.3.2
A practical way to investigate complexity is to:
- Choose a complexity control, such as max_depth for a decision tree or C for an SVM. section 1.3.1 section 1.3.2
- Train models across a range of settings using repeated train/test partitions. section 1.3.1
- Compare mean training and test R² scores; rising training performance without test improvement signals limited value from extra complexity. section 1.3.1 section 1.3.2
- Select complexity for generalization rather than nearly perfect training fit. section 1.3.2
Deeper trees can stop helping
On Friedman-1 regression data, increasing decision-tree depth drives training R² toward 1. Yet test scores remain roughly consistent beyond max_depth=4, so a depth-8 tree fits the training set better without meaningfully improving predictions on new data. section 1.3.1
Figure 1.4 Comparing decision trees of different depths on the Friedman-1 regression data set using R2 as the evaluation metric. Higher R2 scores mean that the model achieves lower error and fits the data better. An R2 score close to 1 means that the model achieves nearly zero error. It’s possible to fit the training data nearly perfectly with very deep decision trees, but such overly complex models actually overfit the training data and don’t generalize well to future data, as evidenced by the test scores.
Compare the diverging training and test curves as tree depth increases: near-perfect training fit can coincide with stagnant test performance. section 1.3.1
Complexity also matters inside ensembles. Base trees can be made more complex through maximum depth, leaf-node limits, or impurity criteria. Highly complex trees are unstable, so an ensemble may need more estimators to reduce their variability; deeper trees also cost more to train and may produce little predictive gain. section 2.5.2
