liveBook · Manning

Expressive power

As explained in Grokking Machine Learning

Model complexity is the degree of flexibility or parameter magnitude that a model has for representing relationships in data.

A model’s expressive power is its flexibility to fit patterns in data. More complex models can fit training data more closely, but may overfit; simpler models may underfit. Complexity can be represented by polynomial degree or measured through coefficient norms. section 4.4 section 4.5

To compare polynomial models, plot training and validation errors against degree. Choose a degree with low validation error: very simple models can underfit, while very complex ones can overfit. section 4.4

Figure 4.5 The model complexity graph is an effective tool to help us determine the ideal complexity of a model to avoid underfitting and overfitting. In this model complexity graph, the horizontal axis represents the degree of several polynomial regression models, from 0 to 10 (i.e., the complexity of the model). The vertical axis represents the error, which in this case is given by the mean absolute error. Notice that the training error starts large and decreases as we move to the right. This is because the more complex our model is, the better it can fit the training data. The validation error, however, starts large, then decreases, and then increases again—very simple models can’t fit our data well (they underfit), whereas very complex models fit our training data but not our validation data because they overfit. A happy point in the middle is where our model neither underfits or overfits, and we can find it using the model complexity graph.

See how training error falls as polynomial degree increases while validation error eventually rises. section 4.4

How Grokking Machine Learning covers it

How deep it goes
Measures complexity through polynomial degree and coefficient norms, then works through validation curves and regularization.
Examples
Uses polynomial degrees 0–10 and a roof-repair analogy to contrast models that are too simple or too complex.
What it assumes
Assumes familiarity with validation sets and polynomial regression rather than teaching either from zero.
What you can do after
Evaluate polynomial degrees with training and validation errors, then select the degree with the lowest validation error.
How it connects
Links model complexity to underfitting, overfitting, validation error, polynomial regression, and regularization.

Also explained in

Compare how 10 books explain expressive power →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Machine Learning. The section links point to the parts of the book it draws on.