Lesson 3 of 6 7 min · 109 words
Model complexity
Degree, depth, number of features and parameters.
Model complexity has many knobs depending on the model family:
- Polynomial regression: the degree.
- Decision trees: maximum depth, minimum samples per leaf.
- k-NN: smaller k = more complex.
- SVMs: the C parameter and kernel width.
- Neural networks: number of layers, units, and training epochs.
- Any model: number of features.
A rough rule: the number of effective parameters should be well below the number of training examples, unless strong regularisation or architecture constraints are in place.
Regularisation lets you keep a flexible model while controlling its effective complexity — a ridge model with many features but large λ behaves like a much simpler one.
Formula to remember
Regularized objective
Data fit plus a complexity penalty Ω.
Quick check · +5 XP