Can an algorithm pick the best Fantasy Football team?

Can an algorithm pick the best Fantasy Football team?

The 2016-17 Barclays Premier League season is hours away, with many anticipating this season to be one of the best.  We have new managers, expensive signings and the question of whether Leicester can defend their title.

For lots of people, the time has come to select a Fantasy Football team and play along to see who is the best armchair manager. But how do you pick the best team?  Do you go for your favourite players, select a team at random or could you use data to help you make your decision? 

Can I write an algorithm to pick the perfect team?

There are nearly 500 players to choose from. My aim is to pick a team that will score the most points over the course of the coming season. Last year’s performance is a good marker for that, right?

For the official Premier League fantasy football league I need to pick 15 players, of which 2 are Goalkeepers, 5 are defenders, 5 are midfielders and 3 are attackers. I have £100m to spend and can only choose three players from the same club.

I started out by selecting the 15 players with the highest Total Score from 2015-16. This team, which includes Mahrez, Vardy, Kane and Aguero would cost me £134m and would net me 2,767 points (based on last year's data). But, I’ve failed on two points here – spending £34m too much and selecting 7 midfielders and 6 attackers in the process.

I need to change my method - I need to change my algorithm.

Maybe I should pick the forwards first and work backwards through the team? If I pick the forwards with the highest scores from last year, I’d be choosing Vardy, Kane and Lukaku. I’d be ditching Aguero - who is the most expensive player you can choose this year - along with some other big names.

If I carry on doing this, by selecting Midfielders then Defenders then the Goalkeeper, I’d get a team worth £115m that would deliver 2,676 points.

I’ve still got a way to go, as I need to shave off another £15m and remove as few points as possible.  I could include one of the 58 midfielders who cost £4.5, but 13 of those "cheaper" players scored no points in 2015-16 and I run the risk of including a "cheaper" player who will net me no points this season.  I'd be spending money with little chance of a return on my investment.

I need some players like West Brom’s Darren Fletcher who secured 103 points last season at £4.5m.  How do I find more Darren Fletcher's and make a choice as to who to pick?

Can I find some “good value” players – those that cost a bit less but still deliver a decent number of points for their price?  Sure, my algorithm can do that, by working out an efficiency metric and using that to help rank the players.

If I tweak my team based on “efficiency” and aim to get the best value players in my team, I’d end up spending £94m and that team would deliver 2,360 points. However, I’d now have 4 Leicester players in the team and I could have spent £6m more.

Am I going round in circles?

My problem is relatively straightforward.  Given a set of constraints, I have to maximise the number of points I can get by spending less than £100m.  There are a number of ways to achieve this and, with a bit of tinkering, my algorithm provides me with some good options.  The algorithm does go around in circles, as optimisation algorithms usually do, continually tweaking options until it finds a solution which could work.  The algorithm was built up from real world decisions; using code to automate the analysis and comparison of data points.

At this stage the algorithm only understands the performance of players based on last year's data.  It doesn't take into account the players, such as Paul Pogba, who didn't play in the Premier League last season.  It doesn't take account of the fixture list or a range of other factors such as how new players will fit into existing teams.

I also need to decide upon my strategy.  For example, am I aiming to go for an "average" number of points per week, or am I happy to risk "boom or bust" weeks - where some weeks I score heavily and some where I don't score much at all.  Depending on which strategy I feel will be the most effective dictates how I tune my algorithm in pursuit of the perfect team.

Who sets the strategy?  Should we let the algorithm select its own strategy, or should a human ultimately be in control?  

In the commercial world, where we routinely build algorithms to help make our businesses sell more, at a better price how should we decide to optimise for turnover, profit or volume?  Over time we can teach our machines to make some of these decisions for us but we still rely on human intervention to make sure that the algorithms are taking us in the right direction.

After a few hours of tweaking my algorithm I have a team I'm happy with.  I've used the algorithm to sort through nearly 500 players in a systematic way to show me the best combinations I could choose to have netted the most points last season.  I've also tried to apply some reasoning to give certain events for this year a probability of occurring.  But, I've had to include some manual context to make sure that the solution I eventually picked is one I can be happy with.  As an iterative process, I've taken the algorithm's output and refined it, making small changes to get me closer to the team I think will do the best.  

It's a mix of computer and human that produces the best results in my opinion, with the machine taking the pain out of looking through and choosing lots of combinations from the underlying data.

This is true for a lot of other data science projects, which "matter" more than simply picking a team for a bit of inter-office fun.  The maths and stats, the code and the algorithm need some careful management to check that the assumptions they've made are valid and fair and that the recommendations they make are the best they can be.  How do we know that the solution we have is the best?  Context is vital for this - without context we just have a lot of numbers which the computer can think are more or less important than they really are.

Building context into our algorithms, to allow our algorithms to make decisions with the same contextual understanding as a human, is the focus of our work right now.  It helps us make decisions based on fact and not opinion alone.  

We can't just build algorithms as a mathematical exercise; we must train our algorithms to make complex decisions in the same way that a human would. And this is both challenging but incredibly exciting.

In a world full of algorithms, with humans writing and tuning the algorithms, the humans will still seek to do things differently than each other, finding novel "tricks" to up or down weight certain factors.  Humans still matter, alongside the computers.

My belief is that my algorithm isn't as good (yet) as some of my more football focused friends or colleagues.  I don't expect to "win" the league this year - but, over the coming football season, we'll learn more about how to add context to the models and I'm fascinated to see what changes I would need to make to the algorithm to help it be more predictive next year.  

It'll be an interesting football season, not least whilst I work out if my algorithm could have picked a better team than my colleagues!

I'll be using this example as part of the conference talks I'm giving over the coming months, including the Chief Data Scientist Europe conference in September and at a Leeds Data Thing event before Christmas.  There will be more detail about how I've done this and an understanding of how successful the algorithm has been.  I'll also explain how this proves to be a useful introduction to algorithms and how some of the issues raised here matter in more commercial problems.  

Marceli K. Król

Doktor nauk ekonomicznych

6 年

"Big data" - the world of analytics, algorithms and statistical models - are increasingly part of our lives, and professional sports such as football are no different. Source https://www.bbc.co.uk/news/science-environment-37327939

回复
Qaim Alvi

Fullstack web development and leadership

7 年

but this is basing everything on last years performance and not accounting for a number of other factor like injuries, older players decliing game, younger players improving game :(

What about taking on real football? Our Data Science teams didn't do too badly.... https://www.dhirubhai.net/pulse/beautiful-mathematical-football-numbers-game-barty-isola?trk=prof-post

回复
Jerry M. Joseph

Director, Technical Account Management at Priceline

8 年
回复
Jay Sewell

Customer & Lending Operations Director

8 年

If only I had your insight and experience in this area Peter! another mid table fantasy season beckons for me....

要查看或添加评论,请登录

Peter Laflin的更多文章

社区洞察

其他会员也浏览了