You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello again. I think I'm really close to adding a workaround to be able to lock players in the single-game formats with MVP and FLEX.
Below is an example where I am testing to try and force Derrick Henry into a certain number of lineups with a specified exposure in the MVP slot and a different specified exposure for one of the FLEX slots. Note: fdpos is a dataframe with just names an positions, used to look up a player's given position in a full slate. In this case it returns RB.
Exception has occurred: GenerateLineupException
Can't generate lineups. Following constraints are not valid: total_players,unique_player_Derrick_Henry
So it looks like the force_group is not being applied successfully. Does anyone know why?
Changing mvp_player.min_exposure to 0 works as expected and 30% of the returned lineups feature Derrick Henry in a flex position. And inversely, if I set flex_player.min_exposure to 0 I get 10% of lineups with Derrick Henry as MVP. So again, it seems like the max_from_group is being ignored and it's trying to make at least one lineup with Derrick Henry in both the MVP and FLEX slots. What is the correct solution here?
The text was updated successfully, but these errors were encountered:
EdCarGoes
changed the title
Setting min_expossure in Fanduel Single Game
Setting min_exposure in Fanduel Single Game
Oct 21, 2024
For whatever it's worth, the lines at the bottom of this post do successfully implement total max exposure and specific MVP slot max exposure. I now believe the min exposure issue is that it's trying to insert all specified min exposure players at the end of the run.
For example if I'm asking it for 10 lineups and I want to force Derrick Henry (assuming he is not naturally exposed in any lineups before the min exposure rule) into 30% of lineups as FLEX and 10% of lineups as MVP. It looks like it's building the first 7 lineups naturally and then starting at #8 it forces him in at FLEX for the last three lineups. But then on lineup 10 it tries to squeeze in the one lineup with him at MVP. Then there are two Derrick Henrys and it breaks. Is this a solver priority thing? Is there a way to adjust that?
Here's the successful overall and MVP-specific max exposure lines.
Hello again. I think I'm really close to adding a workaround to be able to lock players in the single-game formats with MVP and FLEX.
Below is an example where I am testing to try and force Derrick Henry into a certain number of lineups with a specified exposure in the MVP slot and a different specified exposure for one of the FLEX slots. Note: fdpos is a dataframe with just names an positions, used to look up a player's given position in a full slate. In this case it returns RB.
mvp_player = optimizer.player_pool.get_player_by_name('Derrick Henry', 'MVP')
mvp_player.min_exposure = .1
original_position = fdpos.loc[fdpos['Nickname'] == 'Derrick Henry', 'Position'].iloc[0]
flex_player = optimizer.player_pool.get_player_by_name('Derrick Henry', original_position)
flex_player.min_exposure = .3
force_group = PlayersGroup((mvp_player,flex_player), max_from_group=1)
optimizer.add_players_group(force_group)
When I run this I get the error:
Exception has occurred: GenerateLineupException
Can't generate lineups. Following constraints are not valid: total_players,unique_player_Derrick_Henry
So it looks like the force_group is not being applied successfully. Does anyone know why?
Changing mvp_player.min_exposure to 0 works as expected and 30% of the returned lineups feature Derrick Henry in a flex position. And inversely, if I set flex_player.min_exposure to 0 I get 10% of lineups with Derrick Henry as MVP. So again, it seems like the max_from_group is being ignored and it's trying to make at least one lineup with Derrick Henry in both the MVP and FLEX slots. What is the correct solution here?
The text was updated successfully, but these errors were encountered: