pydfs-lineup-optimizer icon indicating copy to clipboard operation
pydfs-lineup-optimizer copied to clipboard

Game stack (NBA DFS)

Open wizardous23 opened this issue 4 years ago • 4 comments

Is there any way I could stack players in 1 game. For example if I wanted to stack the Milwaukee vs Utah game is there a way I could have the optimizer force every lineup that has Donovan Mitchell to have Giannis Antetokoumpo?

wizardous23 avatar Feb 13 '21 03:02 wizardous23

group = PlayersGroup([optimizer.get_player_by_name(name) for name in ('Donovan Mitchell', 'Giannis Antetokoumpo')]) optimizer.add_players_group(group)

bigboyz avatar Feb 15 '21 21:02 bigboyz

group = PlayersGroup([optimizer.get_player_by_name(name) for name in ('Donovan Mitchell', 'Giannis Antetokoumpo')]) optimizer.add_players_group(group)

This gives me 100% exposure to each player which isn't what I want. I just want every lineup that has Player A to have Player B. Any way to do this?

wizardous23 avatar Feb 19 '21 22:02 wizardous23

Use

teams = ['GS', 'MEM']
optimizer.add_players_group(PlayersGroup(players=[player for player in optimizer.players if player.team in teams], min_from_group=7, max_from_group=7))

Just set teams and min and max

Hope thats what your looking for. If you want certain positions i can try to help

Denwen12 avatar Feb 19 '21 22:02 Denwen12

@Denwen12 How would you force a minimum of 1 of ANY player from MIL, AND UTA into every lineup in the example above? lineup 1 have Giannis and Mitchell lineup 2 have Middleton and Mitchell lineup 3 have Giannis and Conley, etc?

lightninglarry avatar Mar 19 '21 10:03 lightninglarry