DimaKudosh / pydfs-lineup-optimizer

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

Adjusting the optimizer to make lineups based on Projected Ownership. #283

Open Scottw1105 opened 3 years ago

Scottw1105 commented 3 years ago

I'm wondering if there's a way to tweak some of the rules in order to build a set of lineups that may mimic a tournament. Let's say we have the projected ownership for a tournament, allowing for duplicated lineups, can we put the ownership as a constraint parameter and let the optimizer build out the most likely lineups for that tournament?

lightninglarry commented 3 years ago

to piggyback onto @Scottw1105 question, is there a way to force 1 or 2 sub 5% owned guys into every lineup? Or is total ownership the only contraint we can use?

McCampy commented 3 years ago

@lightninglarry https://github.com/DimaKudosh/pydfs-lineup-optimizer/issues/261#issuecomment-821808462

lightninglarry commented 3 years ago

Thanks @McCampy

lightninglarry commented 3 years ago

@McCampy i get this error when i use the code from other thread. Any thoughts?

TypeError: '<=' not supported between instances of 'NoneType' and 'float'.

heres the code i used:

optimizer.add_players_group(PlayersGroup( players=[player for player in optimizer.players if player.projected_ownership <= 0.06], min_from_group=2))

optimizer.add_players_group(PlayersGroup( players=[player for player in optimizer.players if player.projected_ownership <= 0.20], max_from_group=2))

Denwen12 commented 3 years ago

Try =<

On Sun, Sep 5, 2021, 11:28 AM lightninglarry @.***> wrote:

@McCampy https://github.com/McCampy i get this error when i use the code from other thread. Any thoughts?

TypeError: '<=' not supported between instances of 'NoneType' and 'float'.

heres the code i used:

optimizer.add_players_group(PlayersGroup( players=[player for player in optimizer.players if player.projected_ownership <= 0.06], min_from_group=2))

optimizer.add_players_group(PlayersGroup( players=[player for player in optimizer.players if player.projected_ownership <= 0.20], max_from_group=2))

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DimaKudosh/pydfs-lineup-optimizer/issues/283#issuecomment-913175493, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANBWO7RBRPIIPVPIS2R7HKLUAOEAJANCNFSM5A7BMVQA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

lightninglarry commented 3 years ago

Try =< On Sun, Sep 5, 2021, 11:28 AM lightninglarry @.***> wrote: @McCampy https://github.com/McCampy i get this error when i use the code from other thread. Any thoughts? TypeError: '<=' not supported between instances of 'NoneType' and 'float'. heres the code i used: optimizer.add_players_group(PlayersGroup( players=[player for player in optimizer.players if player.projected_ownership <= 0.06], min_from_group=2)) optimizer.add_players_group(PlayersGroup( players=[player for player in optimizer.players if player.projected_ownership <= 0.20], max_from_group=2)) — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#283 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANBWO7RBRPIIPVPIS2R7HKLUAOEAJANCNFSM5A7BMVQA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

@Denwen12 Invalid syntax is my error now, so i think the <= is correct.
in my csv the projected_ownership field looks like .20(20 percent), should i change that to a 20 insead?

cwolf908 commented 3 years ago

This seems to be an issue with the site-specific importers (e.g. pydfs-lineup-optimizer/pydfs_lineup_optimizer/sites/draftkings/classic/importer.py) not having the necessary logic to handle projected ownership. I think the _row_to_player function needs some added logic.