DimaKudosh / pydfs-lineup-optimizer

Daily Fantasy Sports lineup optimzer for all popular daily fantasy sports sites
MIT License
424 stars 157 forks source link

How to do a 5, 3 TeamStack MLB Draftkings? #361

Open wizardous23 opened 2 years ago

wizardous23 commented 2 years ago

I'm trying to make a 5 and 3 stack in the same lineup

Is this how you would go about doing it? I seem to be getting a 5 stack just fine but the 3 stack usually ends up being 2 players.

optimizer.add_stack( TeamStack(5, spacing=2, for_positions=['1B', '2B', '3B', 'C', 'SS', 'OF']))
optimizer.add_stack(TeamStack(3, spacing=2, for_positions=['1B', '2B', '3B', 'C', 'SS', 'OF']))
Milkman9691 commented 2 years ago

Just out of curiosity. Why would you want to implement a 5 stack ? Historically a 5 stack has appeared in optimal lineups < 1% of the time appearance of 3 stacks (>10%of the time but <15%) 2-2 stacks (> 20% of the time < 25%) and 2 stacks (>25% of the time). Also in the 2 stacks on multiple occasions the P is generally part of the 2 stack( just started tracking that this year so very small sample so far but of the 20 slates 8 of the 2 stacks has had the P) Sorry for the book

mbencho commented 2 years ago

HITTERS = ('SP','1B', '2B', '3B', 'SS', 'C', 'OF') optimizer.add_stack(PositionsStack([HITTERS] 5)) optimizer.add_stack(PositionsStack([HITTERS] 3))

Milkman9691 commented 2 years ago

optimizer.add_stack(TeamStack(5, for_teams=['MIN'], for_positions=['C', '1B', '2B', '3B', 'SS', 'OF'])) optimizer.add_stack(TeamStack(3, for_teams=['TOR'], for_positions=['C', '1B', '2B', '3B', 'SS', 'OF']))