Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BOOSTS to players based on another player #395

Open
lightninglarry opened this issue Dec 17, 2022 · 4 comments
Open

BOOSTS to players based on another player #395

lightninglarry opened this issue Dec 17, 2022 · 4 comments

Comments

@lightninglarry
Copy link

How could I code in when player A is in lineup, player B gets a positive or negative bump to his projection?

example:
Lebron James and Anthony Davis. Both high ceiling players and high priced. More than likely they dont get to the optimal together. 1 goes off, that hurts other usually.

So If lineup has Lebron, giving AD a -20 % boost to his projection?
Or in NFL
If lineup has QB Josh Allen, giving WR Stefon Diggs a + 20 % boost to his projection?

This would not force or not force guys in, but rather tweak their projections.

@chrisbach1
Copy link

I think you would have to do some complex coding for the optimizer to boost or subtract another players points IF a certain player is selected in a lineup. What I would suggest is looking into the grouping. As far as NBA goes, you are probably better off to make some solid grouping rules or player/position correlation stacks to your optimizer due to the amount of games in one night and the amount of changes made to final rosters before a game. There isn't much time between sites posting starters and the game actually beginning. That, in combination with games starting every 30 minutes, up to 14 games in a single night, and late swapping...it sound like it would be a nightmare.

You can put Lebron and Davis in a group and make it so only 1 is selected.(max_from_group)

group = PlayersGroup(optimizer.player_pool.get_players('LeBron James', 'Anthony Davis'), max_from_group=1)
optimizer.add_players_group(group)

You could also group wide receivers based on if a quarterback is in your lineup. If Josh Allen is in your lineup, it will pair with at least one WR from the group.

group = PlayersGroup(
optimizer.player_pool.get_players('Stephon Diggs', 'Gabriel Davis', 'Isaiah Mckenzie'),
max_from_group=1,
depends_on=optimizer.player_pool.get_player_by_name('Josh Allen'),
strict_depend=False, # if you want to generate lineups with Diggs, Davis, Mckenzie but without Josh Allen
)
optimizer.add_players_group(group)

@lightninglarry
Copy link
Author

i understand the logic and do use your examples that you listed.
I guess my query was more for a smaller/single game type slate. Mainly NFL.
I have access to another premium optimizer that allows to do this, but was just seeing if anyone had insight on ways to do this with python.

@Dr-Two-Inch
Copy link

@lightninglarry I think the easiest programmatic solution here is to add a step during your lineup sorting at the end that boosts the overall projection. For example: if this row contains "Player A" & "Player B" then multiply the total projection by 1.05 #5% boost.

@lightninglarry
Copy link
Author

@Dr-Two-Inch I follow what your saying, but could you give an example with code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants