Knap Kings Greg Dray and Dylan Mortimer Background
Knap Kings Greg Dray and Dylan Mortimer
Background
Daily Fantasy Sports Contest websites Contest formats Contest rules
The Problem Lineup optimizers cost money Good lineups require research Too much data for humans Human bias A computer can do better!
Our Project
Vision Flexible Python package for DFS that leverages algorithmic optimization to deliver strong, personalized lineups to the user
The Algorithm Goal: Optimize total value of your roster Hire P players for N positions $X to spend Player 1. Position 2. Salary 3. Value
The Algorithm (with our constraints) Goal: Optimize total value of your roster Hire P players Constraints Player for N -Must hire for every positions -Hire 2 players for each position 1. -Players play multiple 2. positions -< 4 players from same team 3. $X to spend Position Salary Value
1 2 3 4 Name Cost Value A 20 30 B 10 20 C 30 40 D 40 70 E 10 10 F 20 30 G 10 30 H 30 50 Example problem V[i, x] x (cost) 0 i (position) Position 1 2 3 N=4 10 20 30 40 50 60 X=70
1 2 3 4 Name Cost Value A 20 30 B 10 20 C 30 40 D 40 70 E 10 10 F 20 30 G 10 30 H 30 50 1. Initialize values V[i, x] x (cost) i (position) Position 0 10 20 30 40 50 60 X=70 0 0 0 0 1 2 3 N=4
1 2 3 4 Name Cost Value A 20 30 B 10 20 C 30 40 D 40 70 E 10 10 F 20 30 G 10 30 H 30 50 V[i, x] x (cost) i (position) Position 0 10 20 30 40 50 60 X=70 0 30 G 50 H 50 H 1 2 3 N=4 2. Hire most valuable affordable players for i=N
1 2 3 4 Name Cost Value A 20 30 B 10 20 C 30 40 D 40 70 E 10 10 F 20 30 G 10 30 H 30 50 3. Copy row above V[i, x] x (cost) i (position) Position 0 10 20 30 40 50 60 X=70 3 0 30 30 50 50 50 N=4 0 30 G 50 H 50 H 1 2
if v[i + 1, x - p[i, k]. cost] + p[i, k]. vorp > v[i, x]: 1 2 3 4 Name Cost Value A 20 30 B 10 20 C 30 40 D 40 70 E 10 10 F 20 30 G 10 30 H 30 50 hire(k) V[i, x] x (cost) i (position) Position 0 10 20 30 40 50 60 X=70 3 0 30 30 50 50 50 N=4 0 30 G 50 H 50 H 1 2 4. Compare cells to see if maximum total value is greater if you hire player or not
if v[i + 1, x - p[i, k]. cost] + p[i, k]. vorp > v[i, x]: 1 2 3 4 Name Cost Value A 20 30 B 10 20 C 30 40 D 40 70 E 10 10 F 20 30 G 10 30 H 30 50 hire(k) V[i, x] x (cost) i (position) Position 0 10 20 30 40 50 60 X=70 3 0 30 - 30 50 50 50 N=4 0 30 G 50 H 50 H 1 2 4. Compare cells to see if maximum total value is greater if you hire player or not
if v[i + 1, x - p[i, k]. cost] + p[i, k]. vorp > v[i, x]: 1 2 3 4 Name Cost Value A 20 30 B 10 20 C 30 40 D 40 70 E 10 10 F 20 30 G 10 30 H 30 50 hire(player k) V[i, x] x (cost) i (position) Position 0 10 20 30 40 50 60 X=70 3 0 30 - 40 E 50 50 50 N=4 0 30 G 50 H 50 H 1 2 4. Compare cells to see if maximum total value is greater if you hire player or not
if v[i + 1, x - p[i, k]. cost] + p[i, k]. vorp > v[i, x]: 1 2 3 4 Name Cost Value A 20 30 B 10 20 C 30 40 D 40 70 E 10 10 F 20 30 G 10 30 H 30 50 hire(player k) V[i, x] x (cost) i (position) Position 0 10 20 30 40 50 60 X=70 3 0 30 - 40 E 60 F 50 50 N=4 0 30 G 50 H 50 H 1 2 4. Compare cells to see if maximum total value is greater if you hire player or not
if v[i + 1, x - p[i, k]. cost] + p[i, k]. vorp > v[i, x]: 1 2 3 4 Name Cost Value A 20 30 B 10 20 C 30 40 D 40 70 E 10 10 F 20 30 G 10 30 H 30 50 hire(player k) V[i, x] x (cost) i (position) Position 0 10 20 30 40 50 60 X=70 3 0 30 - 40 E 60 F 50 50 50 N=4 0 30 G 50 H 50 H 1 2 4. Compare cells to see if maximum total value is greater if you hire player or not
if v[i + 1, x - p[i, k]. cost] + p[i, k]. vorp > v[i, x]: 1 2 3 4 Name Cost Value A 20 30 B 10 20 C 30 40 D 40 70 E 10 10 F 20 30 G 10 30 H 30 50 hire(k) V[i, x] x (cost) i (position) Position 0 10 20 30 40 50 60 X=70 3 0 30 - 40 E 60 F 60 F N=4 0 30 G 50 H 50 H 1 2 Finish row and repeat steps upwards
Our Progress
Original Goals ● Scrape multiple well-known projections ○ ○ Number. Fire Roto. Grinders ● Upload custom projections ● Optimize lineups ○ ○ ○ Fan. Duel Draft. Kings Single Entry Contests Multiple Entry Contests Lock Players Exclude Players ● Enter lineups into competition automatically ● Expand to other sports
Goals Accomplished Midway ● Scrape multiple well-known projections ○ ○ Number. Fire Roto. Grinders ● Upload custom projections ● Optimize lineups ○ ○ ○ Fan. Duel Draft. Kings Single Entry Contests Multiple Entry Contests Lock Players Exclude Players ● Enter lineups into competition automatically ● Expand to other sports
Final Goals Accomplished ● Scrape multiple well-known projections ○ ○ Number. Fire Roto. Grinders ● Upload custom projections ● Optimize lineups ○ ○ ○ Fan. Duel Draft. Kings Single Entry Contests Multiple Entry Contests Lock Players Exclude Players ● Enter lineups into competition automatically ● Login to Fan. Duel automatically ● Optimizer for both basketball and baseball
Results Summary User selects. . . Output Contest website(s) Projection website(s) # lineups to output Players to lock/exclude Optimal lineup(s) given constraints
Our Testing Method
Methodology ● Draft. Kings ○ Enter Daily Dollar (single entry) ● Fanduel (One for rotogrinders and numberfire) ○ Enter $1 single entry ○ Enter $1 50/50 entry
Our Success
Winnings ● Draft. Kings (since 4/21) ○ + $10. 84 ● Fanduel (since 4/15) ○ + $18. 74 ○ Rotogrinders ○ ○ ○ ■ ~ $14 Numberfire ■ ~ $4 Tournament ■ ~ $15 50/50 ■ ~ $4
Reflecting
Reflecting ● Exciting! ○ Algorithm about as optimal as proprietary optimizers ○ Implemented most of the same features successfully ○ Single entry bets appear profitable in long run ● Annoying : ( ○ Limitations mostly a lack of access to data ■ Scraping issues ■ Expensive APIs
Demo
- Slides: 31