-
Notifications
You must be signed in to change notification settings - Fork 679
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
Support for 2+ outcomes #499
Conversation
One note to be added: The SMART strategy has not been converted to support more than 2 strategies. |
IMO the smart strategy should probably take the 2 outcomes with the most people rather than the 2 first (which is obviously random). Based on most people is a decision to make but I think that it makes sense. Smart used to take the choice with most people but if these are too close (~ almost same chances) it takes the one with most potential gain. That's what I did in my fork, if I have some time to spare I'll try to gather stats on how it behaves. |
Currently I changed line 158~ in .\classes\entities\Bet.py like this: |
@lazinism by removing comments and formatting your code, we get: self.total_users = ( sum(map(lambda x:x[OutcomeKeys.TOTAL_USERS],self.outcomes))
self.total_points = ( sum(map(lambda x:x[OutcomeKeys.TOTAL_POINTS],self.outcomes))
if ( self.total_users > 0 and all(map(lambda x:x[OutcomeKeys.TOTAL_POINTS]>0, self.outcomes)) ): Right? |
@lazinism Do we really need to use if ( self.total_users > 0 and self.total_points > 0 ): ? |
@lazinism Your solution with sum(), map() and lambda-functions is just an elegant way of doing: #inefficient but otherwise outcomekeys are represented wrong.
self.total_points = 0
self.total_users = 0
for index in range(0, len(self.outcomes)):
self.total_users += self.outcomes[index][OutcomeKeys.TOTAL_USERS]
self.total_points += self.outcomes[index][OutcomeKeys.TOTAL_POINTS] right? It is basically the same thing, or am I missing something? |
Yes I think it's same |
@lazinism Do we really need to use: if ( self.total_users > 0 and all(map(lambda x:x[OutcomeKeys.TOTAL_POINTS]>0, self.outcomes)) ): Can't we just use: if ( self.total_users > 0 and self.total_points > 0 ): ? |
I wrote it like that because Original code was self.total_users > 0 and self.outcomes[0][OutcomeKeys.TOTAL_POINTS] > 0 and self.outcomes[1][OutcomeKeys.TOTAL_POINTS] > 0 and I can't predict what would happen if I change code to |
so the purpose of the changed code I wrote was to preserve as many original code as i can, but change it from considering only 2 options to multiple options. In that view, you can understand why I wrote code like that 👍 |
Description
Implements basic support for predictions with more than two potential outcomes. Part of the fix included modifying how choices were interpreted by changing decision["choice"] to be the index rather than a letter being used as intermediary.
Basic safeguards for the divide by zero error were added in as well.
Fixes #497
Limited support for predictions with more than 2 outcomes.
Type of change
How Has This Been Tested?
This has been tested 4-5 times on predictions with more than 2 outcomes, most of which utilizing 10 (the new limit).
Checklist: