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
What's in this chapter
How a network is built from nodes and hidden layers, why it needs activation functions, how backpropagation trains it, how it handles more than two classes, a playground to build your own, and a network written from scratch in Python. With a hundred-odd matches a network can overfit quickly, and the exercises let you watch that happen.