Fantasy Football Data Analysis / Draft Helper

This write-up is a work in progress...

After missing the play-offs in my fantasy football league last year, I wanted to spend some time looking into fantasy football data analysis, to possibly get a leg up come draft day or when evaluating match-ups during the season.  I can't say that I was hugely devoted to this little project, since fantasy football is more than just stats and getting the absolute best, more fine-grained data would cost money, and because I didn't want to sink too much time into doing this.  But I absolutely did want to explore the field and see what I could come up with using only freely available data and not spending more than a couple weeks working on it.

Yahoo! Fantasy Sports provides a RESTful API for their fantasy data.  I also found a project on GitHub, called python-yahooapi, that provides a Python class for accessing the Yahoo! Fantasy Sports API, which was great because I did not want to deal with the OAuth authorization myself to use the API.  After cloning that project, I started writing my own Python script to start collecting player data via the API and store it all in an SQLite database.

I collected data on the top 100 players from each fantasy football position (QB, RB, WR, TE, DEF/ST, K).  The main database table had a row for each player, with the columns including player ID number, player name, team, position, bye week, percentage of fantasy leagues where the player was owned by a team, average draft position, position rank, and projected points.  A secondary database table stored stats for each player.  There were 81 stats in total, such as Games Player, Rushing Yard, Receiving TDs, etc.  These stats were collected for each player, for each of their past 3 seasons (when applicable).

With the database populated, it was time for me to figure out what kind of analysis I'd like to do with it.  I thought about collecting weekly stats for each player, from their past seasons and from this upcoming season as it went on.  From this, I could try to evaluate how players would do in their weekly match-ups, and do some analysis of player consistency or injury history.  However, I wanted some more immediate results, so I decided to focus on the draft, the all-important first step to a fantasy season.  I decided to create a Draft Helper application, which would help me draft the best team possible in my 12-team league's snake draft.

I had recently read Matthew Berry's 2014 Draft Day Manifesto, which talked a lot about getting the most bang-for-your-buck in terms of draft picks and how to try to get an edge over other teams in one position or another.  For example, if the top 3 ranked QBs have had significantly more points than the next 10 QBs, but among those next 10 QBs, their season point totals only vary by a much smaller amount, then you might come up with the strategy of either picking up a top 3 QB, or just waiting a few more rounds to pick up one of the lower QBs in that next 10 list.  In this scenario, if the top 3 QBs have already been picked, then why choose the 4th ranked QB with your next pick, when you could instead pick up a player in a different position, and then pick up maybe the 8th ranked QB in the next round, or two rounds from now, and they won't perform that much worse than the 4th ranked QB.  Each draft pick is worth something, with the earlier picks obviously being more valuable than the later draft picks, and as a fantasy team owner, your objective is to put together the best complete team given your fixed positions in the draft.  Therefore, you want the most bang-for-your-buck/draft pick and you want to end up with a team, i.e. the combination of all your starting players, that will get you the most points.

With this in mind, one should not draft using a greedy approach, i.e. simply picking the available player projected to score the most points (presumably also with the constraint that they play a position that you still need to fill on your roster), as this doesn't take into account any concept of value/bang-for-your-buck or try to optimize the resulting team's scoring potential.  Of course, very few people actually draft according to a greedy approach.  Most people aim to draft a RB first because good RBs score well and are consistent, whereas QBs, who often score more points in a season, are more like a dime-a-dozen type of commodity.  And people also know to wait on picking a kicker, usually until the last round, since they are very much a dime-a-dozen commodity, with very similar scoring potential and very little risk of injury or any other complications during the season.

A better systematic way to draft is to try to optimize your team's total scoring potential, accounting for the "value" of the players

No comments:

Post a Comment