If you have any questions about the code here, feel free to reach out to me on Twitter or on Reddit.

Shameless Plug Section

If you like Fantasy Football and have an interest in learning how to code, check out our Ultimate Guide on Learning Python with Fantasy Football Online Course. Here is a link to purchase for 15% off. The course includes 15 chapters of material, 14 hours of video, hundreds of data sets, lifetime updates, and a Slack channel invite to join the Fantasy Football with Python community.

Completing our Value Based Draft Model

In this part of the intermediate series, we are going to finish up our value based draft model.

In this last part, we talked about how you can use positional value to decide who to draft for two players at different positions with different projected points. Our solution was to calculate a replacement value for each position, find each player's value over replacement, and then finally, sort the table in descending order.

There's one problem with going strictly off this value-based ranking model, though. It's not good enough to draft players at value, we also want to know their ADP so we can attempt to get the biggest bargain on each player. Once we load in our draft model again, you'll see what I mean.

What we are going to do in this post is join ADP data with the value based model, and try to find gaps in ADP rank and value rank. The players with high ADPs and low value ranks are our overvalued players, and the players going later in the draft but should go sooner based off our value model are our sleepers.

Let's import some libraries we'll need first.

And then let's copy/paste the code from last time to get our value model. Again, this analysis is for PPR, but you can find ADP data for standard and half ppr by visiting fantasypros.com. The code will be exactly the same to scrape the data.

PLAYER POS FPTS VOR VALUERANK
0 Christian McCaffrey RB 366.5 214.5 1.0
0 Michael Thomas WR 326.4 161.3 2.0
1 Saquon Barkley RB 305.9 153.9 3.0
2 Ezekiel Elliott RB 299.2 147.2 4.0
5 Alvin Kamara RB 294.9 142.9 5.0
4 Dalvin Cook RB 289.5 137.5 6.0
1 Davante Adams WR 289.2 124.1 7.0
2 Julio Jones WR 279.7 114.6 8.0
0 Travis Kelce TE 254.2 107.5 9.0
3 Derrick Henry RB 259.1 107.1 10.0
7 Clyde Edwards-Helaire RB 252.0 100.0 11.0
9 Miles Sanders RB 249.5 97.5 12.0
14 Austin Ekeler RB 248.4 96.4 13.0
5 DeAndre Hopkins WR 260.0 94.9 14.0
12 Kenyan Drake RB 245.6 93.6 15.0
3 Tyreek Hill WR 257.3 92.2 16.0
10 Aaron Jones RB 239.5 87.5 17.0
8 Joe Mixon RB 238.9 86.9 18.0
1 George Kittle TE 233.5 86.8 19.0
4 Chris Godwin WR 250.4 85.3 20.0
0 Lamar Jackson QB 355.4 81.5 21.0
6 Nick Chubb RB 227.4 75.4 22.0
8 D.J. Moore WR 238.8 73.7 23.0
12 Robert Woods WR 237.8 72.7 24.0
6 Mike Evans WR 237.6 72.5 25.0
11 Josh Jacobs RB 223.6 71.6 26.0
19 Le'Veon Bell RB 222.7 70.7 27.0
17 Leonard Fournette RB 222.4 70.4 28.0
7 Kenny Golladay WR 234.3 69.2 29.0
15 Cooper Kupp WR 233.8 68.7 30.0
1 Patrick Mahomes QB 342.0 68.1 31.0
16 Allen Robinson WR 232.7 67.6 32.0
15 Todd Gurley RB 217.1 65.1 33.0
9 Adam Thielen WR 230.0 64.9 34.0
11 Amari Cooper WR 229.1 64.0 35.0
13 Chris Carson RB 215.8 63.8 36.0
14 Calvin Ridley WR 228.4 63.3 37.0
3 Zach Ertz TE 209.8 63.1 38.0
19 Keenan Allen WR 226.7 61.6 39.0
16 David Johnson RB 213.4 61.4 40.0
13 Tyler Lockett WR 223.8 58.7 41.0
18 James Conner RB 208.6 56.6 42.0
22 JuJu Smith-Schuster WR 221.5 56.4 43.0
17 Odell Beckham Jr. WR 220.9 55.8 44.0
20 Melvin Gordon RB 205.8 53.8 45.0
10 A.J. Brown WR 216.7 51.6 46.0
18 DeVante Parker WR 214.5 49.4 47.0
20 Courtland Sutton WR 212.7 47.6 48.0
21 Terry McLaurin WR 211.7 46.6 49.0
24 T.Y. Hilton WR 209.3 44.2 50.0
4 Darren Waller TE 190.2 43.5 51.0
2 Mark Andrews TE 189.9 43.2 52.0
27 Jarvis Landry WR 205.9 40.8 53.0
2 Dak Prescott QB 314.1 40.2 54.0
3 Deshaun Watson QB 312.1 38.2 55.0
23 D.K. Metcalf WR 203.2 38.1 56.0
26 Stefon Diggs WR 201.6 36.5 57.0
28 A.J. Green WR 201.5 36.4 58.0
30 D.J. Chark WR 201.4 36.3 59.0
32 Tyler Boyd WR 199.5 34.4 60.5
25 Michael Gallup WR 199.5 34.4 60.5
33 Julian Edelman WR 198.0 32.9 62.0
29 Marquise Brown WR 196.1 31.0 63.0
4 Russell Wilson QB 304.1 30.2 64.0
24 Devin Singletary RB 180.8 28.8 65.0
31 Marvin Jones WR 188.8 23.7 66.0
29 Kareem Hunt RB 175.4 23.4 68.0
36 Jamison Crowder WR 188.5 23.4 68.0
23 Ronald Jones II RB 175.4 23.4 68.0
5 Evan Engram TE 168.0 21.3 70.0
5 Kyler Murray QB 294.9 21.0 71.0
21 Mark Ingram II RB 172.0 20.0 72.0
36 Tarik Cohen RB 171.2 19.2 73.0
37 Diontae Johnson WR 182.1 17.0 74.0
6 Josh Allen QB 290.9 17.0 75.0
22 Jonathan Taylor RB 168.1 16.1 76.5
38 Christian Kirk WR 181.2 16.1 76.5
41 Sterling Shepard WR 179.9 14.8 78.0
8 Tyler Higbee TE 161.0 14.3 79.0
27 D'Andre Swift RB 165.5 13.5 80.0
7 Matt Ryan QB 286.7 12.8 81.0
25 David Montgomery RB 164.1 12.1 82.0
34 Will Fuller WR 177.1 12.0 83.0
6 Hunter Henry TE 158.6 11.9 84.0
35 Brandin Cooks WR 176.9 11.8 85.0
37 James White RB 162.7 10.7 86.0
39 Preston Williams WR 174.3 9.2 87.0
44 Golden Tate WR 174.0 8.9 88.0
28 Cam Akers RB 159.2 7.2 89.0
26 Raheem Mostert RB 159.1 7.1 90.0
8 Tom Brady QB 278.0 4.1 91.0
9 Drew Brees QB 275.9 2.0 92.0
11 Hayden Hurst TE 147.0 0.3 93.0
40 John Brown WR 165.1 0.0 95.5
30 Kerryon Johnson RB 152.0 0.0 95.5
7 Jared Cook TE 146.7 0.0 95.5
10 Aaron Rodgers QB 273.9 0.0 95.5
42 Deebo Samuel WR 164.0 -1.1 98.0
11 Carson Wentz QB 270.3 -3.6 99.0
13 Mike Gesicki TE 142.6 -4.1 100.0

Now, let's join this data with ADP data on the PLAYER and POS columns. We can do this using the DataFrame method merge. You could also use join, but the join method requires you to set an index, while the merge method does not.

PLAYER POS AVG
0 Christian McCaffrey RB 1.0
1 Saquon Barkley RB 2.0
2 Ezekiel Elliott RB 3.3
3 Dalvin Cook RB 4.7
4 Michael Thomas WR 5.0

Let's rank the AVG column to come up with an ADP rank.

PLAYER POS AVG ADPRANK
0 Christian McCaffrey RB 1.0 1.0
1 Saquon Barkley RB 2.0 2.0
2 Ezekiel Elliott RB 3.3 3.0
3 Dalvin Cook RB 4.7 4.0
4 Michael Thomas WR 5.0 5.0

Our ADP data is now ready to be merged with our value model.

PLAYER POS FPTS VOR VALUERANK AVG ADPRANK
0 Christian McCaffrey RB 366.5 214.5 1.0 1.0 1.0
1 Michael Thomas WR 326.4 161.3 2.0 5.0 5.0
2 Saquon Barkley RB 305.9 153.9 3.0 2.0 2.0
3 Ezekiel Elliott RB 299.2 147.2 4.0 3.3 3.0
4 Alvin Kamara RB 294.9 142.9 5.0 5.0 6.0

Awesome, so here, we left joined these two tables together on their common columns. A left join is when you want to keep all of the rows of the left table that don't match in the right table, and drop all the rows that don't match in the right table. Here, our left table is the original df, and our right table is the adp_df. Let's investigate the final df object so we can find some examples of players who have a large gap in ADP and value rank.

PLAYER POS FPTS VOR VALUERANK AVG ADPRANK
0 Christian McCaffrey RB 366.5 214.5 1.0 1.0 1.0
1 Michael Thomas WR 326.4 161.3 2.0 5.0 5.0
2 Saquon Barkley RB 305.9 153.9 3.0 2.0 2.0
3 Ezekiel Elliott RB 299.2 147.2 4.0 3.3 3.0
4 Alvin Kamara RB 294.9 142.9 5.0 5.0 6.0
5 Dalvin Cook RB 289.5 137.5 6.0 4.7 4.0
6 Davante Adams WR 289.2 124.1 7.0 12.7 9.0
7 Julio Jones WR 279.7 114.6 8.0 15.7 16.0
8 Travis Kelce TE 254.2 107.5 9.0 18.0 20.0
9 Derrick Henry RB 259.1 107.1 10.0 7.7 7.0
10 Clyde Edwards-Helaire RB 252.0 100.0 11.0 16.3 18.0
11 Miles Sanders RB 249.5 97.5 12.0 13.3 10.0
12 Austin Ekeler RB 248.4 96.4 13.0 16.0 17.0
13 DeAndre Hopkins WR 260.0 94.9 14.0 11.3 8.0
14 Kenyan Drake RB 245.6 93.6 15.0 15.0 13.0
15 Tyreek Hill WR 257.3 92.2 16.0 15.3 15.0
16 Aaron Jones RB 239.5 87.5 17.0 17.7 19.0
17 Joe Mixon RB 238.9 86.9 18.0 15.3 14.0
18 George Kittle TE 233.5 86.8 19.0 21.3 23.0
19 Chris Godwin WR 250.4 85.3 20.0 19.0 21.0
20 Lamar Jackson QB 355.4 81.5 21.0 20.0 22.0
21 Nick Chubb RB 227.4 75.4 22.0 14.0 11.0
22 D.J. Moore WR 238.8 73.7 23.0 30.3 28.0
23 Robert Woods WR 237.8 72.7 24.0 47.3 47.0
24 Mike Evans WR 237.6 72.5 25.0 26.3 26.0
25 Josh Jacobs RB 223.6 71.6 26.0 15.0 12.0
26 Le'Veon Bell RB 222.7 70.7 27.0 36.7 36.0
27 Leonard Fournette RB 222.4 70.4 28.0 29.3 27.0
28 Kenny Golladay WR 234.3 69.2 29.0 25.0 25.0
29 Cooper Kupp WR 233.8 68.7 30.0 37.7 37.0
30 Patrick Mahomes QB 342.0 68.1 31.0 21.3 24.0
31 Allen Robinson WR 232.7 67.6 32.0 31.7 30.0
32 Todd Gurley RB 217.1 65.1 33.0 31.7 31.0
33 Adam Thielen WR 230.0 64.9 34.0 34.0 35.0
34 Amari Cooper WR 229.1 64.0 35.0 33.7 34.0
35 Chris Carson RB 215.8 63.8 36.0 33.7 33.0
36 Calvin Ridley WR 228.4 63.3 37.0 44.3 45.0
37 Zach Ertz TE 209.8 63.1 38.0 39.3 38.0
38 Keenan Allen WR 226.7 61.6 39.0 50.7 48.0
39 David Johnson RB 213.4 61.4 40.0 41.0 40.0
40 Tyler Lockett WR 223.8 58.7 41.0 51.0 50.0
41 James Conner RB 208.6 56.6 42.0 43.3 43.0
42 JuJu Smith-Schuster WR 221.5 56.4 43.0 32.7 32.0
43 Odell Beckham Jr. WR 220.9 55.8 44.0 30.7 29.0
44 Melvin Gordon RB 205.8 53.8 45.0 42.0 42.0
45 A.J. Brown WR 216.7 51.6 46.0 40.3 39.0
46 DeVante Parker WR 214.5 49.4 47.0 56.7 56.0
47 Courtland Sutton WR 212.7 47.6 48.0 43.7 44.0
48 Terry McLaurin WR 211.7 46.6 49.0 59.7 61.0
49 T.Y. Hilton WR 209.3 44.2 50.0 58.0 58.0
50 Darren Waller TE 190.2 43.5 51.0 56.0 53.0
51 Mark Andrews TE 189.9 43.2 52.0 42.0 41.0
52 Jarvis Landry WR 205.9 40.8 53.0 67.0 68.0
53 Dak Prescott QB 314.1 40.2 54.0 54.7 52.0
54 Deshaun Watson QB 312.1 38.2 55.0 58.0 57.0
55 D.K. Metcalf WR 203.2 38.1 56.0 54.7 51.0
56 Stefon Diggs WR 201.6 36.5 57.0 59.3 60.0
57 A.J. Green WR 201.5 36.4 58.0 69.0 69.0
58 D.J. Chark WR 201.4 36.3 59.0 56.3 55.0
59 Tyler Boyd WR 199.5 34.4 60.5 73.7 72.0
60 Michael Gallup WR 199.5 34.4 60.5 75.7 73.0
61 Julian Edelman WR 198.0 32.9 62.0 76.3 74.0
62 Marquise Brown WR 196.1 31.0 63.0 72.3 71.0
63 Russell Wilson QB 304.1 30.2 64.0 58.7 59.0
64 Devin Singletary RB 180.8 28.8 65.0 50.7 49.0
65 Marvin Jones WR 188.8 23.7 66.0 87.7 84.0
66 Kareem Hunt RB 175.4 23.4 68.0 61.7 66.0
67 Jamison Crowder WR 188.5 23.4 68.0 101.3 97.0
68 Ronald Jones II RB 175.4 23.4 68.0 79.3 76.0
69 Evan Engram TE 168.0 21.3 70.0 70.3 70.0
70 Kyler Murray QB 294.9 21.0 71.0 56.3 54.0
71 Mark Ingram II RB 172.0 20.0 72.0 60.7 64.0
72 Tarik Cohen RB 171.2 19.2 73.0 89.7 88.0
73 Diontae Johnson WR 182.1 17.0 74.0 101.7 98.0
74 Josh Allen QB 290.9 17.0 75.0 89.7 89.0
75 Jonathan Taylor RB 168.1 16.1 76.5 47.0 46.0
76 Christian Kirk WR 181.2 16.1 76.5 98.7 95.0
77 Sterling Shepard WR 179.9 14.8 78.0 107.3 102.0
78 Tyler Higbee TE 161.0 14.3 79.0 80.7 77.0
79 D'Andre Swift RB 165.5 13.5 80.0 60.0 63.0
80 Matt Ryan QB 286.7 12.8 81.0 86.3 83.0
81 David Montgomery RB 164.1 12.1 82.0 60.0 62.0
82 Will Fuller WR 177.1 12.0 83.0 78.0 75.0
83 Hunter Henry TE 158.6 11.9 84.0 83.0 80.0
84 Brandin Cooks WR 176.9 11.8 85.0 88.7 86.0
85 James White RB 162.7 10.7 86.0 83.3 81.0
86 Preston Williams WR 174.3 9.2 87.0 132.7 130.0
87 Golden Tate WR 174.0 8.9 88.0 133.7 131.0
88 Cam Akers RB 159.2 7.2 89.0 64.7 67.0
89 Raheem Mostert RB 159.1 7.1 90.0 61.3 65.0
90 Tom Brady QB 278.0 4.1 91.0 81.3 79.0
91 Drew Brees QB 275.9 2.0 92.0 85.7 82.0
92 Hayden Hurst TE 147.0 0.3 93.0 112.0 110.0
93 John Brown WR 165.1 0.0 95.5 105.0 100.0
94 Kerryon Johnson RB 152.0 0.0 95.5 101.7 99.0
95 Jared Cook TE 146.7 0.0 95.5 100.3 96.0
96 Aaron Rodgers QB 273.9 0.0 95.5 98.3 94.0
97 Deebo Samuel WR 164.0 -1.1 98.0 88.0 85.0
98 Carson Wentz QB 270.3 -3.6 99.0 97.7 93.0
99 Mike Gesicki TE 142.6 -4.1 100.0 128.0 126.0

How We Can Use ADP To Our Advantage

One example that popped out to me is Robert Woods. Robert Woods has a value rank of 23 but an ADP rank of 46. See, if we were going straight based off our value rank, we might jump right at drafting robert woods when he comes to us at that 20-30 spot in the draft. But if we know his ADP, we know that we can take a calculated risk and wait a couple rounds to draft him later, resulting in an even bargain on the pick.

Let's say we're team 5 in this draft. At round 3, Robert Woods is eligible for us to draft just based off his value ranking. But because we know his ADP is around 46, we can take a risk and wait two more rounds and pick him up in round 5, getting an even bigger bargain.

Not only that, but we can also turn our attention to a player who's value rank is around 20-25 and might not be available in the next 2 rounds or even the next round, given their ADP.

I don't believe in drafting straight off ADP, but I do believe in using ADP in this way to inform your decision on who to draft where. It's not fool proof, someone in your league may reach and pick him up in the next round. But we can still use ADP to inform us of where Robert Woods on average is going to go. In this way, we're using ADP data to our advantage.

Let's calculate sleeper and overvalued ranks based off our df and sort the tables to find those players who want to look out for and potentially get a bargain on, and those players we'd like to avoid (unless they fall to us at their value rank).

PLAYER POS FPTS VOR VALUERANK AVG ADPRANK SLEEPERSCORE
111 Cam Newton QB 263.4 -10.5 112.0 182.7 177.0 65.0
110 DeSean Jackson WR 155.0 -10.1 111.0 156.7 156.0 45.0
87 Golden Tate WR 174.0 8.9 88.0 133.7 131.0 43.0
86 Preston Williams WR 174.3 9.2 87.0 132.7 130.0 43.0
118 Sammy Watkins WR 150.3 -14.8 119.0 163.7 162.0 43.0
117 Chris Herndon IV TE 132.0 -14.7 118.0 160.7 160.0 42.0
115 Breshad Perriman WR 151.0 -14.1 116.0 156.7 155.0 39.0
105 Anthony Miller WR 159.5 -5.6 106.0 146.7 144.0 38.0
135 Allen Lazard WR 141.1 -24.0 136.0 177.7 172.0 36.0
142 Gardner Minshew II QB 246.2 -27.7 143.0 178.0 174.0 31.0
67 Jamison Crowder WR 188.5 23.4 68.0 101.3 97.0 29.0
136 Blake Jarwin TE 122.3 -24.4 137.0 170.7 166.0 29.0
108 Jalen Reagor WR 156.9 -8.2 108.5 137.0 137.0 28.5
99 Mike Gesicki TE 142.6 -4.1 100.0 128.0 126.0 26.0
126 Jack Doyle TE 127.1 -19.6 127.0 155.3 153.0 26.0

These are our top sleepers for 2020. Let's sort the table in ascending order to find our top overvalued players.

PLAYER POS FPTS VOR VALUERANK AVG ADPRANK SLEEPERSCORE
156 J.K. Dobbins RB 116.2 -35.8 157.0 93.7 91.0 -66.0
183 Alexander Mattison RB 96.0 -56.0 184.0 127.0 124.0 -60.0
178 Ke'Shawn Vaughn RB 98.9 -53.1 179.0 124.7 119.0 -60.0
214 A.J. Dillon RB 71.5 -80.5 215.0 170.0 165.0 -50.0
224 Damien Harris RB 67.5 -84.5 225.0 187.3 180.0 -45.0
162 Sony Michel RB 111.0 -41.0 163.0 125.0 120.0 -43.0
145 Latavius Murray RB 121.7 -30.3 146.0 110.3 106.0 -40.0
173 Tony Pollard RB 102.7 -49.3 174.0 136.0 136.0 -38.0
195 Chase Edmonds RB 88.1 -63.9 196.0 159.0 159.0 -37.0
152 Zack Moss RB 119.2 -32.8 153.0 118.3 116.0 -37.0
125 Jordan Howard RB 133.0 -19.0 126.0 92.3 90.0 -36.0
138 Tevin Coleman RB 126.5 -25.5 139.0 110.3 107.0 -32.0
211 LeSean McCoy RB 73.8 -78.2 212.0 187.7 181.0 -31.0
148 Darrell Henderson RB 120.3 -31.7 149.0 122.0 118.0 -31.0
75 Jonathan Taylor RB 168.1 16.1 76.5 47.0 46.0 -30.5

And that's it for this post! Our draft model is complete. For reference, I ran this draft model through a FantasyPros mock drafter and got a score of 93, whatever that's worth.

I guarentee if you follow this method of leveraging value scores and ADP together, you will at least be in a good position to make the playoffs after your draft. Championships, I can't guarentee. Championships are won after the draft.

Thanks for reading, you guys are awesome!