pydfs-lineup-optimizer icon indicating copy to clipboard operation
pydfs-lineup-optimizer copied to clipboard

Adjusting the optimizer to make lineups based on Projected Ownership.

Open Scottw1105 opened this issue 4 years ago • 7 comments

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?

Scottw1105 avatar Jul 26 '21 00:07 Scottw1105

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?

lightninglarry avatar Aug 18 '21 13:08 lightninglarry

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

McCampy avatar Aug 19 '21 00:08 McCampy

Thanks @McCampy

lightninglarry avatar Aug 19 '21 10:08 lightninglarry

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

lightninglarry avatar Sep 05 '21 15:09 lightninglarry

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.

Denwen12 avatar Sep 05 '21 16:09 Denwen12

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?

lightninglarry avatar Sep 05 '21 16:09 lightninglarry

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.

cwolf908 avatar Sep 23 '21 15:09 cwolf908