Teaching an algorithm to watch football

In a press box overlooking the pitch, an analyst traces a passing move beside a scoring model and a phone showing a fantasy lineup.

We spent nights and weekends trying to turn “he's having a good game” into something a computer could calculate.

Anyone who watches football knows how much fits inside that sentence. A midfielder can be excellent without scoring. A player can complete plenty of passes and contribute very little. A commentator moves between individual actions and a judgment about the whole performance almost without thinking. Writing down how to do that takes considerably longer.

At INNAAS, we integrated more than 300 measures into our scoring system. The work began with football analysis for TIM and Lega Serie A and eventually became part of FantaSerieATIM, the league's official fantasy game. Suddenly, the judgment our software produced mattered to someone choosing a team, watching a match and deciding whether to make a substitution.

I found this problem irresistible. Here was a familiar human activity, full of argument and intuition, that we could examine through data. Every weekend gave us more material. Every weekend also found ways to complicate our assumptions.

The first demonstration had been Italy–Costa Rica at the 2014 World Cup. We invited TIM executives to watch the match alongside our performance indicators. Two teams, two numbers changing over time, almost like financial tickers. An enormous amount of activity on the pitch became something people could follow at a glance. That demonstration helped open the door to TIM Stadium and, later, the fantasy game.

The simplicity on the screen was the attraction. Underneath it, we had to decide what a performance meant.

From measurements to judgment

Our approach used fuzzy operators. We took quantitative measurements, expressed them through qualitative concepts, combined those judgments, and produced a quantitative score again.

Measurements → qualitative judgments → performance score.

That middle step mattered. Words such as “good” or “poor” have soft edges. A tiny change in a measurement should not automatically turn a strong performance into a weak one. Fuzzy logic lets you represent degrees: a value can belong partly to neighbouring categories, and several conditions can contribute to a judgment together. Those judgments can then be combined into a numerical result. That is the broad fuzzy inference principle; the difficult work was deciding how it should apply to football.

Consider passing as a simple example. A completion percentage tells you something. The player's role, the difficulty of the passes and what the team needs tell you more. A useful evaluation has to decide how those things interact. Adding another column of data does not make that decision for you.

This was what occupied so many evenings. We would look at the behaviour of the model, revisit a judgment, tune it, and look again. You can make a score convincing for one player in one match quite easily. Making the same reasoning hold across different roles and very different games is much harder.

I became suspicious of the ease with which a numerical result acquires authority. We chose the measures and how to combine them. Putting a decimal point on the output did not relieve us of those choices. It made them more consequential, because other people would use the result.

Screens from FantaSerieATIM showing player performance, substitutions and a live challenge

Player scores, substitutions and live challenges. Screens from the product archive.

We updated the scores approximately every 30 seconds. The model had to remain useful while the match was happening. A beautiful assessment delivered after someone needed to make a substitution would have missed the point of the product.

Here is a rough way to picture the volume. Take 300 measures, 11 players on each of two teams, and 180 half-minute updates over a 90-minute match:

300 × 11 × 2 × 180 = 1,188,000 measure-values across the match.

That is an illustrative estimate assuming all 300 measures are reconsidered for every on-pitch player at every update. It includes repeated values, ignores stoppage time, and is not a count of unique actions or a benchmark of our production system. The number gives a sense of the work hidden behind a score. The harder question was still whether the score made sense.

When the model becomes somebody's game

We met Riccardo Albini, the inventor of Fantacalcio, to convince him to join the project as an adviser. I wanted the experience of someone who understood why people returned to this game every week. We knew a great deal about processing performances. He brought a different kind of knowledge about the choices, arguments and pleasure that make a fantasy game worth playing.

Then I met Pierluigi Pardo, and we shot the launch video. After all the nights spent on algorithms, seeing the project explained by a voice so familiar to football fans was a particular pleasure. It was becoming something people could pick up and use.

Pierluigi Pardo presenting FantaSerieATIM in the launch video published by Serie A TIM

Pardo presenting the game in the launch video, published on 10 December 2015.

TIM and Lega Serie A presented FantaSerieATIM on 10 December 2015. Within about three months, I remember us reaching more than 170,000 active users over a weekend, playing from around the world. For a small team, that was an extraordinary audience to have waiting for the next update.

Football made the consequences of our modeling choices unusually visible. People cared about a player's rating. They compared performances. Their own decisions depended on the output. You could spend a long time explaining the sophistication of the system; they wanted to know whether it rewarded a good game fairly.

That is the lesson I carry into other business problems. Before choosing a model, get close to the judgment someone is trying to make. Find out what they notice, what they disagree about and when the answer becomes useful. Then make your assumptions explicit enough to examine and improve.

I still find this corner of AI charming: a human judgment, hundreds of measurements, some carefully designed mathematics, and a person on a sofa deciding whether to substitute a midfielder. We spent a remarkable amount of time making that last decision a little more interesting.

Earlier: the match that convinced TIM · Later: getting into Y Combinator