The Fantasy Football computer

The Fantasy Football computer

A computer program to play Fantasy Football, “it can’t be done” we say. There are just too many things to think about. What players will a team’s manager pick next week? Who has good fixtures? Who is suspended? What about double game weeks, and wild cards? It’s just too hard.

Well think again.

In 2012 Dr. Sarvapali Ramchurn, who teaches Electronics and Computer Science at the University of Southampton, published a little known research paper called “Competing with humans at fantasy football: team formation in large partially-observable domains” with his colleagues Tim Matthews, also at Southampton, and Georgios Chalkiadakis, of the Technical University of Crete.

The paper covered how they created a computer model of real-world football and gave it the the rules of Fantasy Football. They then used this program to choose a Fantasy Football team and manage its weekly transfers and wild cards.

If I tell you in the 2011/12 season, Dr. Ramchurn’s model achieved 2222 points and was in the top 500 in the world, then surely us Fantasy managers have to sit up and take note.

The tool was clever enough to process lots of different transfer options each week. It would create a potential team, look at the probability of the team achieving points, and compare it to another team option, rule out the weaker team, and repeat until they were left with the just one formation.

Fantasy Football ComputerThe simulation was also able to process not just the upcoming week, but many weeks in advance, meaning the program could plan for double game weeks, no-game weeks, strong teams facing a run of weaker teams etc. The program was able to create what it felt was a team to get the highest number of points over a number of weeks and not just one.

Once it had what it felt to be the optimal team formation to get the maximum Fantasy Football points (including points hits) for the upcoming game week and beyond, the transfers were executed.

This is fairly amazing given there are more than 500 possible footballers, all with different prices and merits, selectable in over 10,000,000,000,000,000,000,000,000 combinations per week (yes, that is the real number), and us Fantasy Football managers must make 38 such selections over the season.

How did they do it?

Build an expectation of points for a player

Player StatsThey defined what they felt was the probability of the points a player might score. This is harder than it sounds. Usual football models like Otpa and the EA Sports Rank focus on modelling full-time match score lines.

This is fine when estimating the outcome of a game, but when you want to estimate the chance a specific player will earn Fantasy Football points they had to be more granular, as a team could still do badly but one player do exceptionally well.

So to model each individual player they built a simple player-based model (using the Dixon and Robinson 1998 framework). Each player had a “baseline” based on past performance which defined the probability of the points the player might score. The baseline included a probability that the player might be absent through injury, suspension, or international duty. The model then refined this probability each week based on the events of the previous week.

Take into account the club a player is at, and the fixtures they face

To do this the model predicted the outcomes of games – it worked out the scores!

Fantasy Football RobotWell, they calculated lots of different score lines. They worked out a collection of scores for each game and applied odds to each score – like bookies do.

They then again refined the potential points for each player based on the odds for each score line. The model was clever enough to look at each club’s attacking and defending abilities from past results (including the opposing team).

It then calculated the probability of each player on either side scoring a goal at any point within a given match, IE, it took into account the way a club attacks and defends (its style), and the likelihood of a player being subbed, to work out the likelihood of goals, a clean sheet and the likelihood of assists.

This part was very clever as the model was capable of working out what might happen to the score line if a player was substituted at any given time, and also different formations.

Do it all again for the next game week

The model was able to look more than one week ahead, or else each week it would have done a load of transfers. So each week it was capable of picking players for the long term.

It is interesting to note they only considered the upcoming 4 weeks, and found looking further ahead did not lead to any corresponding performance benefit.

In geek speak

We model the problem as a Bayesian reinforcement learning one, where the action space is exponential in the number of players and where the decision maker’s beliefs are over multiple characteristics of each footballer. We then exploit domain knowledge to construct computationally tractable solution techniques in order to build a competitive automated Fantasy Football manager. Thus, we are able to establish the baseline performance in this domain, even without complete information on footballers’ performances (accessible to human managers), showing that our agent is able to rank at around the top percentile when pitched against 2.5M human players

What did it not do

The model was not able to avoid recommending players who are currently injured, suspended or on international duty. It was only able to work out the probability that they might be away.

Excerpt from an interview

This interview was conducted in 2012 but makes references to the 2010/11 & 2011/12 season…

So, how does the software measure up right now? You say it’s in the top 1 percent of all players—does it actually play in the league?

Dr. Sarvapali Ramchurn and Tim Matthews

Dr. Sarvapali Ramchurn and Tim Matthews

Sarvapali Ramchurn: So, basically what we’ve done is take data from the previous season—or one season before that—and played out our automated fantasy player against the rules of the game.

So we looked at the match outcomes for every single week; we played the team that was suggested according to the automated player and scored its performance based on the real scores of the fantasy football league.

So, basically if we had entered for real, if we had actually played it in 2010, the performance would actually have been what we got, and we’re doing the same for the 2011–2012 league. So you can play things retrospectively in this case because it doesn’t really matter whether you’re playing it live—basically, if you get what I mean, it’s just based on the number of points that every player gets for a specific match, and therefore you can play everything retrospectively.

So we’re planning to enter for real now, in the real league, and see whether we can actually show off how well the fantasy football player is playing against actual humans every week.

And you’re planning, I gather, to add some human intelligence—for example, information about last-minute injuries and other bits of information?

Sarvapali Ramchurn: Yes. So what we think is going to be the winning formula, is combining the human intelligence with the machine intelligence—basically, the machine being able to foresee what’s going to happen. So, using this Bayesian approach: being able to play out various futures and formulating probabilities of things happening in the future in a way that humans cannot do.

And we saw an example of that today in Henry Kautz’s lecture at AAAI, where he was talking about how Kasparov and the machine play better than Kasparov on his own or the machine on its own, and then when you have a team of players playing with the machine, then they play better than Kasparov and the machine.

So we think the same thing will apply to fantasy football, just because humans have got a better understanding of players. There are already some sources of statistics about player injuries and statistics that are more detailed than what we have used so far, so we are planning to exploit those in order to improve what the machine can do but also get input from humans to basically formulate a better strategy about how to go about playing fantasy football: picking out the players, for example, that are sort of growing in terms of performance or picking those players that are likely to perform well against teams that they can attack the defense better, for example.

Fantasy football works at the level of individual players which are spread out among different teams. I’m just wondering: If you give the software just all and only the players on a single team and do that for two teams, you would have software that would try to predict who would win an actual football game. Have you thought about that?

Sarvapali Ramchurn: Yeah. So, we’ve been looking at analysing the statistics to predict whether a certain team would win, and we do some of that already within the algorithm, but we don’t go too deep into that because there are already lots of research being done on predicting football match outcomes. We’re not trying to compete with that, but we’re trying to reuse some of that to play better fantasy football.

So lots of these statistics are already being used by betting companies, for example, to set odds and by people who just like to research football, so there are lots of papers on predicting match outcomes. So what matters in our case is the sequential nature of the problem—so, when you need to pick a team that needs to perform well over a long period of time, not just for the next game. So, what could be probably looking at is looking at the best prediction for the winner of a league rather than for the winner of a match.

So, looking at how many points a team might acquire over multiple matches given the formation of players it chooses to buy at the beginning of the league. So that’s the kind of thing we could do. So if you wanted to put a bet on the winner of a league, maybe our software could be used.

From this we can learn

  • Past player performance is important. If a defender is on a run of clean sheets, a run of assists or a striker on a run of goals, then we should think this important.
  • We need to look at least four weeks ahead when planning our team
  • Historical team performance of one club against another is a good indication of how the score is likely to go, but this seems to be less important than individual performance.
  • Playing time is important. It might seem obvious, but a player who is on the pitch for the full 90 minutes is likely to get more fantasy football points than someone on the pitch for only 65 minutes. So when picking our teams we should avoid players who tend to get subbed.
  • The wildcards were played in the 8th week and the 23rd weeks. I don’t know why the 8th week was chosen, I suspect to get a good platform based on the opening of the season. The 23rd game week corresponds with the close of the January transfer window.
  • This site uses price as the player’s baseline, and reports when a player is getting more or less points than expected (against the baseline) from the previous 4 weeks. We use the game difficulty checker to then say if a player faces good or hard fixtures to make recommendations on players to choose for your team. The process has some great similarities.
  • I’m left with the feeling that the use of stats and real-world knowledge is a very powerful combination when planning your Fantasy Football Team

What we don’t know

  • How many transfers per week the model did?
  • Did any player stay in the model’s team for the whole season?
  • What was the model’s preferred team-formation?

Does this research have real value, beyond our fun game?

Emergency ReliefIn a disaster-emergency, like a Tsunami, there are teams of helpers on the ground with different skills and different emergencies to respond to. Getting the organisation of these teams right can mean more lives saved.

For example, if there is a constraint on Doctors, Firefighters, Emergency Vehicles or Medical Packs, what is the best use of the team and the resources? Ramchurn, Matthews, and Chalkiadakis hope to use this research to help with the organisation of disaster recovery teams in real time. A very worthwhile cause from our little game.

What do you think? Are there observations or lessons Chorley has missed? Is this useful in real-world planning of your Fantasy Football team?

The 2010 interview first appeared in The Computer That Beat Two Million Humans at Fantasy Football and some of the transcript has been reproduced with kind permission of Steven Cherry.

21 thoughts on “The Fantasy Football computer

  1. Great article CR. I found the use of historical team performance interesting as it could take into account “bogey teams” for example Everton have beaten Man City in 4 of their last 6 matches so the computer program could recommend Fellaini for a goal or Baines for a penalty/free kick or assist.

    • Thanks cRVP. I found the topic interesting to research & write.

      I’m not sure how the idea of ‘bogey teams’ sits with the idea of ‘return to normal form’ (from the Sports Illustrated article). I remember Southampton used to be United’s bogey team for a while.

      I’ll see if I can find any related research next week as last 6 encounters could be worth highlighting next season.

      Did you write anything with those stats you made?

      • No I haven’t really had the time but my main goal for doing it was to help find potential bargains for next season say if a team had two home games in a row against poor opposition then I could use the stats to get a player likely to score at home.

  2. I wonder how these guys got the idea, I guess they must have been fantasy fans to even think about it.

    • I’d expect them to be fans. I don’t know if they thought ‘what is a simplification of maths for disaster zone planning, ah, look Fantasy Football is similar’, or ‘lets do the maths for Fantasy Football, and find an application afterwards’.

      I’ll drop them an email & ask.

    • What you forgot to mention in the article is that the computer now has a name ” ChorleyzorroRocks” and has started up its own internet site to help people with their teams ;)

      HPAPY BATRHIDY OZROR ( I’m sure you can work that one out)

  3. What do you guys make of Baines potentially joining United from an FPL perspective ? He will lose his penalty spot duties but more frequent clean sheets could make him a viable option for this season coming.

    • For United in general I think he would get caught out of position when playing in Europe. For FPL, probably fewer assists for both Baines and Pienaar.

  4. Dr. Ramchurn & Tim Matthews who made “The Fantasy Football Computer” got in touch by email. They have given permission for me to post the email here…

    Hi Chorley,

    The article looks really comprehensive. As you guessed, we’re both fantasy fans. But actually we’re not statisticians, so the model of player points that we use in the 2012 paper is really quite naive (it doesn’t even take into account typical playing formations, for instance).

    We’ve improved the model and long-term prediction aspects over the last year and hope to roll this up into an app over the next few months when we get time, so we’ll send an e-mail your way when we do!


    Tim and Gopal

    Thanks for getting in touch guys :)

Comments are closed.