DimaKudosh / pydfs-lineup-optimizer

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

Game stack (NBA DFS) #244

Open wizardous23 opened 3 years ago

wizardous23 commented 3 years ago

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?

bigboyz commented 3 years ago

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

wizardous23 commented 3 years ago

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?

Denwen12 commented 3 years ago

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

lightninglarry commented 3 years ago

@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?