THE GENIUS PROJECT
๐Ÿฅ… Lesson 6 of 9

Predicting a penalty

๐Ÿ•’ About 24 minutes ๐Ÿ“Š Real placement data ๐ŸŽฏ Take the penalty
A goalkeeper spreads his arms in front of the goal net as a penalty comes in, with a nine-zone heat map glowing over the goal mouth
cold โ†’ hot ๐Ÿฅ… The heat map behind the keeper: where penalties really go
A real penalty, seen the way a model sees it. Each zone glows by how often penalties land there: the two bottom corners run hottest at about 19% each, dead centre stays cold. This picture, built from thousands of past kicks, is exactly what we assemble in this lesson.

A penalty is over in half a second, too fast for a keeper to react to the ball. So keepers guess before it is struck, and the best guesses come from data. In this lesson you will predict where a kick goes using the real patterns, then take penalties yourself.

Why this is a prediction problem

Split the goal into nine zones, three across and three high. "Where will the ball go?" is now a question with nine possible answers. Picking one is called classification, the same family as Lessons 2 and 3, just with nine classes instead of two.

A keeper cannot wait to see the ball; there is not enough time. So they play the odds, leaning the way the data says a shot is most likely. A model trained on thousands of past penalties learns exactly those odds.

The real numbers

Across analyses of thousands of professional penalties, the placement is far from random. The bottom corners are the most popular targets, dead centre is used least (keepers rarely stay still, but they usually dive), and the top corners are the hardest to save yet also the easiest to drag wide.

๐Ÿ“Š What the data says
  • Each bottom corner takes roughly 19% of penalties, the two most common spots by far.
  • Dead centre gets under 10%, even though keepers dive most of the time.
  • Top corners are nearly unsaveable when on target, but far more likely to miss the goal completely.
  • Around 3 in 4 penalties are scored overall.

Figures are rounded from public analyses of large penalty datasets and vary by study; use them as a guide, not gospel.

Take the penalty

The grid below is shaded by how often penalties land in each zone (darker means more common). Predict where the next kick will go by clicking a zone, then take the penalty and see where it actually flies. Play a few and watch your accuracy climb as you learn to trust the data.

How to use this lab
  1. Look at the shading: darker zones catch more penalties. The two bottom corners are the safest bets.
  2. Click a zone to predict where the kick will go.
  3. Press Take the penalty! and watch the ball fly. The keeper dives too.
  4. See if your prediction matched, and whether it was a goal or a save. Your accuracy is tracked at the bottom.
Click a zone to predict where the penalty will go.
โœ‹ Check your understanding
If a model could only shout one zone before every penalty, which is the smartest single guess?

How a real model does better

Guessing a bottom corner every time is a decent baseline, but a real model does more. It uses features about this exact kick to shift the nine probabilities: which foot the taker uses, their run-up angle, the score in the game, and above all where this player has put past penalties. Feed those in and the model might say "72% chance bottom-left for this left-footer under pressure," and the keeper dives early with confidence.

This is the same toolkit from the whole course, pointed at one tiny, high-stakes moment. And it is real: elite keepers study these probability sheets before every shoot-out.

How it is actually done

The grid you just played with only knows the crowd average. A real penalty model is a small data pipeline that tailors those nine numbers to the exact kicker, the keeper, and the moment. Here is the whole chain.

๐Ÿ—‚๏ธEvent dataThousands of logged penalties
๐ŸŽ›๏ธFeaturesFoot, angle, history, pressure
๐ŸงฎModelTurns features into odds
๐ŸŽฏNine probabilitiesOne per zone, adding to 100%

1. The data it learns from

Analysts feed the model event data: every professional penalty on record, each one tagged with who took it, which foot, the keeper, the score and the minute, the run-up, and the zone the ball ended up in. Top clubs add tracking and pose data pulled from video, the taker's body angle and the keeper's early lean, captured frame by frame.

2. The features that matter

From that raw log, a handful of features do most of the work:

3. The models that turn features into odds

Predicting one of nine zones is multiclass classification. The gentlest model for it is the direct big sibling of Lesson 2's logistic regression, called softmax. Logistic regression squashes into one probability; softmax spreads scores across all nine zones so they add up to 100%:

$$P(\text{zone } j) = \frac{e^{z_j}}{\sum_{k=1}^{9} e^{z_k}}$$

Each zone $j$ gets a score $z_j$ from the features, and softmax turns the nine scores into nine probabilities. That is the core idea. In practice, teams reach for a few model families:

๐Ÿง  It is also a mind game

Penalties are not only a data problem, they are a standoff. If you always aim bottom-left, keepers learn it and wait for it. The maths of two players who each have to stay unpredictable is called game theory, and the best takers mix their targets on purpose. A good model predicts the odds; a great taker keeps those odds honest.

Turn counts into odds yourself

Before any fancy model, the core move is simply turning past counts into probabilities. Press Run to watch the nine zone counts become a clean set of odds that add up to 100%.

๐Ÿ penalty_odds.py
import numpy as np

# how often past penalties landed in each of the 9 zones (a 3x3 grid)
counts = np.array([[ 9,  3, 11],
                   [13,  6, 13],
                   [19,  7, 19]])

# turn counts into probabilities: divide each by the total
probs = counts / counts.sum()

print("Chance the ball lands in each zone (%):")
print((probs * 100).round(1))
print("Best single guess: a bottom corner at 19%")
Output
Chance the ball lands in each zone (%):
[[ 9.  3. 11.]
 [13.  6. 13.]
 [19.  7. 19.]]
Best single guess: a bottom corner at 19%

A real model does the same thing, then bends each number using the features above, which is how the flat heat map at the top of this lesson becomes a sharp read for one exact kick.

๐Ÿง  Recap
  • Predicting a penalty's zone is classification with nine classes.
  • The data is far from random: bottom corners dominate, centre is rare, top corners are risky.
  • A smart baseline is to always guess a bottom corner.
  • A real model uses features (foot, angle, the taker's history) to sharpen the odds for each kick.
  • The direct model is softmax (multiclass logistic regression); in practice tree ensembles like XGBoost and neural networks reading video do the heavy lifting.
  • It is a mind game too: game theory says the best takers stay unpredictable on purpose.

You have met the models. Next: turn them into real code.