DimaKudosh / pydfs-lineup-optimizer

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

FEATURE REQUEST: Min/Max Exposure Sensitivity #340

Open kryptickevin opened 2 years ago

kryptickevin commented 2 years ago

Hello, I would like to request a feature for future revs. Currently when building lineups with max exposures set, it is a strict setting with no give to the numbers set. If it is unable to complete the build with the max exposures set, the build will fail. Can we please get a setting that allows us to choose how strictly we follow our max exposure settings?

For example, there could be:

  1. exposure_sensitivity = strict
  2. exposure_sensitivity = balanced
  3. exposure_sensitivity = loose

Strict sensitivity would be a hard stop, it gets the exact exposure. Balanced is close. Loose means that it will try its best but the exposure settings will never cause the build to fail.

@DimaKudosh thoughts?

Thanks, Kevin

DimaKudosh commented 2 years ago

Hi, player that achieved max exposure will be completely removed from optimization and can't appear in the next lineups. As a workaround, I can disable removing players from optimization and significantly decrease their projections, in this case, it should work as you described. The scale of decrease will be configured by the user: small decrease will work like 'loose' mode, the bigger decrease will work as 'balanced' mode.

kryptickevin commented 2 years ago

Hi, player that achieved max exposure will be completely removed from optimization and can't appear in the next lineups. As a workaround, I can disable removing players from optimization and significantly decrease their projections, in this case, it should work as you described. The scale of decrease will be configured by the user: small decrease will work like 'loose' mode, the bigger decrease will work as 'balanced' mode.

@DimaKudosh Thank you for taking the time to comment and reply. I appreciate it, especially with your workload. It is possible this solution could work, but let me better explain the issue. The idea is that currently some builds will fail due to exposure constraints, whether they be constraints of min or max exposure. If we could "soften" the rule, so that it has the flexibility to allow the build to still complete (within reason), this would be what I am looking for. I believe the solution you mentioned may only work for max_exposure constraints, but I want your opinion.

Thanks again.

DimaKudosh commented 2 years ago

Lineups are generated separately and before generating each lineup I check all exposures (min/max) and lock/delete players that reach exposures. I can't set 'soft' constraints for solvers because it works only in a strict way. I think the same method can work with min_exposure, instead of locking increase projections, but I need to test how it will work.

kryptickevin commented 2 years ago

That makes sense. Your proposed solution does sound like it could work. I understand your workload, so whenever you have a moment it is greatly appreciated.