Machine learning with football · Chapter 8

Neural networks

When the pattern is not a straight line and you cannot guess the right feature cross, let a network find it.

Estimated time: 5 minutes · page 1 of 7

A pattern no line can draw

The board maps every finished match of Premier League by two numbers: the home side's goal difference per game across, the away side's up. Draws are filled dots, 30 of 111. The shading is a model's draw chance, darker where it's higher.

Switch to the linear model, b + w₁x₁ + w₂x₂ passed through a sigmoid as in chapter 3. Its shading can only slope in one direction across the whole map. But draws don't work like that. They cluster where the two teams are close, often around the middle where both are average, and thin out toward the mismatches. That's a nonlinear pattern.

Chapter 5 handled the one-dimensional version by adding x² by hand, and chapter 6 crossed categories by hand. That works when you can guess the right combination. A neural network finds the combinations itself while it trains. Switch back to the network and its shading bends around where the draws are.

Check yourself

Why can a linear model not draw the pattern on the board?
What does a neural network do that chapter 6's feature crosses did by hand?

Leagues