The sigmoid bends a straight line into a curve that stays between 0 and 100%, and that curve is the model.
Estimated time: 15 minutes · page 2 of 4
The sigmoid
A straight line runs off forever in both directions. A probability has to stay between 0 and 1. The sigmoid function fixes that. Whatever number goes in, a probability comes out:
σ(z) = 1 / (1 + e−z)
e is about 2.718. Feed it a big positive number and the answer creeps toward 1, a big negative one and it creeps toward 0, and 0 itself gives exactly 0.5. It never reaches 0 or 1, however far you go.
The orange dot is the match picked on the board, at the z your sliders give it.
z
-4
-3
-2
-1
0
1
2
3
4
σ(z)
0.018
0.047
0.119
0.269
0.500
0.731
0.881
0.953
0.982
The model
The straight line from chapter 2 is still there. It just stops being the answer and becomes the input to the sigmoid:
z = b + w · x
y′ = σ(z)
With more features z simply gets more terms, b + w₁x₁ + w₂x₂ and so on. Here is one match worked through with your sliders. Click any dot on the board to pick another.
Arsenal FC 3–0 Coventry City FC, so y = 1
x = 1.64 goals of difference per game in the home side's favour
z = 0.00 + 0.00 · 1.64 = 0.00
y′ = 1 / (1 + e0.00) = 50% chance of a home win
Check yourself
Log-odds, and what bookmakers already know
Solve the sigmoid for z and you get the logarithm of the odds:
z = ln( y′ / (1 − y′) )
A 75% home win chance is 75 to 25, odds of 3 to 1, and ln 3 ≈ 1.1. That's why z is called the log-odds. Bettors know this scale from the other side. Decimal odds of 1.33 mean the bookmaker thinks it's about 75%, before its margin.
Press Show best curve and the numbers mean something. In Premier League the best fit has b = -0.32, so between two equally good teams the home side wins 42% of the time. Draws make that lower than you might guess. The weight w = 0.82 says each extra goal of difference per game multiplies the odds of a home win by ew = 2.3.