BenBrostoff / draftfast

A tool to automate and optimize DraftKings and FanDuel lineup construction.
287 stars 113 forks source link

Banning Defense? #37

Closed chppppp closed 7 years ago

chppppp commented 7 years ago

Happy holidays all :) Is there a quick hack to support banning defenses? I've been digging around but figured I would ask!

Thanks!

BenBrostoff commented 7 years ago

@chppppp This is definitely possible. I will poke around and get back to you by Saturday. Happy holidays to you! :+1:

chppppp commented 7 years ago

Thanks Ben. If i come up with anything I'll update here.

On Dec 23, 2016 4:20 PM, "Ben Brostoff" notifications@github.com wrote:

@chppppp https://github.com/chppppp This is definitely possible. I will poke around and get back to you by Saturday. Happy holidays to you! 👍

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BenBrostoff/draft-kings-fun/issues/37#issuecomment-269046833, or mute the thread https://github.com/notifications/unsubscribe-auth/AGz0hScMVC69MEJDJApG_p8BFDLt707Oks5rLDsUgaJpZM4LVCSn .

BenBrostoff commented 7 years ago

@chppppp This looks like a weird formatting issue. Most recent commit should resolve. Using the current week's data for all Saturday games with Rotogrinders as my source, here's what I get:

python optimize.py -source nfl_rotogrinders -i 1
Optimal roster for: NFL
+----------+----------------+------+--------------------+--------+------------+----------+--------+
| Position | Player         | Team | Matchup            | Salary | Projection | vs. Avg. | Locked |
+----------+----------------+------+--------------------+--------+------------+----------+--------+
| RB       | DeMarco Murray | Ten  | Ten@Jax 01:00PM ET | 7,000  | 19.86      | -1.49    |        |
| WR       | Jordy Nelson   | GB   | Min@GB 01:00PM ET  | 7,000  | 18.76      | -0.433   |        |
| WR       | Brandin Cooks  | NO   | TB@NO 04:25PM ET   | 6,800  | 18.27      | 1.441    |        |
| RB       | Jordan Howard  | Chi  | Was@Chi 01:00PM ET | 6,300  | 17.19      | 0.359    |        |
| WR       | Michael Thomas | NO   | TB@NO 04:25PM ET   | 6,000  | 17.98      | 1.342    |        |
| QB       | Blake Bortles  | Jax  | Ten@Jax 01:00PM ET | 5,000  | 18.19      | -0.329   |        |
| TE       | Delanie Walker | Ten  | Ten@Jax 01:00PM ET | 4,300  | 13.66      | 0.483    |        |
| TE       | Cameron Brate  | TB   | TB@NO 04:25PM ET   | 3,900  | 13.1       | 1.471    |        |
| DST      | Chargers       | SD   | SD@Cle 01:00PM ET  | 3,400  | 11.4       | 3.9      |        |
+----------+----------------+------+--------------------+--------+------------+----------+--------+

Projected Score: 148.41      Cost: $49,700
Projection Source: Rotogrinders

If I eliminate the Chargers D, it looks like the Patriots replace them:

python optimize.py -source nfl_rotogrinders -i 1 -banned "Chargers"
Optimal roster for: NFL
+----------+----------------+------+--------------------+--------+------------+----------+--------+
| Position | Player         | Team | Matchup            | Salary | Projection | vs. Avg. | Locked |
+----------+----------------+------+--------------------+--------+------------+----------+--------+
| RB       | DeMarco Murray | Ten  | Ten@Jax 01:00PM ET | 7,000  | 19.86      | -1.49    |        |
| WR       | Jordy Nelson   | GB   | Min@GB 01:00PM ET  | 7,000  | 18.76      | -0.433   |        |
| WR       | Brandin Cooks  | NO   | TB@NO 04:25PM ET   | 6,800  | 18.27      | 1.441    |        |
| RB       | Jordan Howard  | Chi  | Was@Chi 01:00PM ET | 6,300  | 17.19      | 0.359    |        |
| WR       | Michael Thomas | NO   | TB@NO 04:25PM ET   | 6,000  | 17.98      | 1.342    |        |
| QB       | Blake Bortles  | Jax  | Ten@Jax 01:00PM ET | 5,000  | 18.19      | -0.329   |        |
| TE       | Delanie Walker | Ten  | Ten@Jax 01:00PM ET | 4,300  | 13.66      | 0.483    |        |
| TE       | Cameron Brate  | TB   | TB@NO 04:25PM ET   | 3,900  | 13.1       | 1.471    |        |
| DST      | Patriots       | NE   | NYJ@NE 01:00PM ET  | 3,600  | 11.32      | 3.677    |        |
+----------+----------------+------+--------------------+--------+------------+----------+--------+

Projected Score: 148.33      Cost: $49,900
Projection Source: Rotogrinders

Let me know if this works for you.

chppppp commented 7 years ago

It works! Thank you sir.