July 15th, 2024

Win your fantasy league using operations research

Operations research techniques are applied to excel in fantasy football leagues by treating player selection as a knapsack problem. Cost-effective players delivering high scores are chosen within budget constraints, optimizing team value effectively.

Read original articleLink Icon
Win your fantasy league using operations research

Using operations research techniques, the author discusses how to excel in a fantasy football league by treating player selection as a knapsack problem. By maximizing the value of a team within a set budget, the strategy involves choosing cost-effective players who deliver high scores. The knapsack problem analogy is apt, where selecting players is akin to filling a limited backpack with valuable artifacts. The article delves into the technical aspects of implementing this strategy, including data scraping for player information, predicting player performance based on past scores, and setting team constraints. The solution involves using Google's OR-tools to optimize player selection while adhering to budget and position constraints. The author tested this approach in fantasy leagues and achieved competitive results, showcasing the effectiveness of the operations research methodology in fantasy sports.

Link Icon 13 comments
By @2d8a875f-39a2-4 - 7 months
I've used similar approaches to play sports fantasy games (casually) since 2009. Using LP solvers like this team selection games, and an ELO+regression approach for score/margin prediction games. Mostly as a way to beat friends while spending little or no time following the actual competition.

For team selection games the LP approach works great but does not dominate, as described in the OP. I've found it to work less well over the years and I wouldn't be surprised if the fantasy game vendors have been explicitly adding countermeasures - things like temporary wildcards, round-specific rules, trading limits and velocities, etc all mess with your LP constraints. Not that you couldn't also code that up but it's time consuming. You end up needing to follow the competition closely anyway and using your model as an advisor to spot "good deals" in the data.

edit: a few times I have also back tested my models vs the odds offered by the bookies (for the margin prediction games). Unsurprisingly the bookies have better models than me. Could be just using the bookies odds as the pick is a better approach.

By @ukoki - 7 months
Nice, I did a similar thing in 2018 with linear programming: https://peterellisjones.com/posts/fantasy-machine-learning/

I didn't win my friends' league, but definitely got closer than previous years

By @snake_plissken - 7 months
I really want to use these advanced approaches more, and they make a lot of sense in the daily fantasy scene (this analysis was for tourney long EURO 2024 I think?), but for something like season long NFL, I am convinced it is mostly luck:

  Hope your top 3 picks stay healthy

  Hope your 3-4 "flyer" picks (the guys who are on a new team, rookies, etc.,) don't completely bust

  Play the waiver wire (mid week pickups to fill in positions where needed) well
The one part where more skill/operations research is involved would be playing the matchups (top defense vs crap offense, WR1 vs rookie corner) but even then it's not a surefire recipe for success since there is so much variance (that top WR play might be nuked by a run oriented game). But it is playing smart so you should do it.
By @reaperducer - 7 months
Heard on WGN Radio last week:

"My buddy and I were playing fantasy football, and he said, 'Letʼs make it interesting.' So we stopped playing fantasy football."

By @manvillej - 7 months
My favorite field, Operations Research. Nothing is as sweet. Nothing as elegant. Nothing as mindbreakingly infurating when you don't know the answer yet.
By @0xcafecafe - 7 months
"I’m from Spain, so I’m speaking about the real and original football, the one that’s played with the foot and a ball, not with the hands and an egg"

Ha

By @dehrmann - 7 months
> It didn’t consider the schedule of matches

This dynamic makes fantasy sports a second-order game, and predicting regular sports outcomes is hard enough. You're not just trying to pick the best players for the best price, you also have to consider the scenarios those players will be in any given week.

By @tea-coffee - 7 months
Which data did you use? Since the leagues were from the Quarterfinals and onwards, was it data from the group stages, euro qualifiers? Averaging the last 5 games would introduce a lot of variance, especially in tournament football.
By @mp05 - 7 months
> The obvious solution for a data scientist like me was to use machine learning. But I didn’t. I just took the average score by the player during the last 5 games.

Wait, is he cracking a joke? If so, haha.

By @SubiculumCode - 7 months
The open league results are in part explained by the drop out rate of players who start then lose interest after a few weeks. Comparing against active players might be more reasonable (assuming this league wasn't choose once and do nothing for the season).
By @protocolture - 7 months
The most important thing is to make sure you use an encrypted email auth protocol.

I was in a tipping comp years ago. At this workplace I had already warned the management against insecure email protocols but they wouldnt listen.

Anyway, came time for the company footy tipping comp.

Once I worked out which manager was running it, I used their plaintext password against their admin login to the tipping website. Worked straight up.

Every week I would make my tips, then after the games had been run but before Monday rolled around, I would use the admin access to change my tips.

Didnt try and hide it just went 100% victory every week.

The admin of the comp would even go out of his way to try and satisfy the very angry football fans that it wasnt run on company systems so theres no way that I could find my way in to change things.

In the end I fessed up, I couldnt get them to change the email system, but he apparently proactively took the password post it note off of his monitor which was nice.

By @thaumasiotes - 7 months
> If you happen to know how a player will perform in the game next week, please call me and we’ll get very rich and not just win a stupid fantasy game.

Another classic of the genre "why would I need you?"

By @zeroonetwothree - 7 months
“Operations research” is a very fancy way of solving the knapsack problem (a simple algorithm you can implement in 10 min)