-
Notifications
You must be signed in to change notification settings - Fork 2
Better approach to minimum share in roulette #1310
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
base: main
Are you sure you want to change the base?
Conversation
| }); | ||
|
|
||
| it('should return second variant', () => { | ||
| it('should return third variant', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test name was wrong here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's an issue in the calculation of the solutions over 0.1. I also think there's a bias towards solutions with 0 over those with 0.11 - which should have a much higher value in comparison.
| return { | ||
| variantName, | ||
| weight: Math.max(mean / sumOfMeans, minWeight), | ||
| weight: weight < minWeight ? minWeight : 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern with this is if you have v1 = 0 and v2 = 0.11. then clearly v2 is performing much better than v1. However, the min weight assignment will increase v1 to 0.1 giving a 0.01 difference to the two versions. This over promotes very poor solutions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point, I guess this implementation assumes that variants have a low weight because we don't have enough data, rather than because they're just terrible!
| const weights: { weight: number; variantName: string }[] = minimumWeights | ||
| .map(({ variantName, weight, mean }) => ({ | ||
| variantName, | ||
| weight: weight === 0 ? remainder * (mean / sumOfNonReservedMeans) : weight, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the mean is 0.01 and the sumOfNonReservedMeans is 1, then this would be given a weight of 0.01 -- much lower than a variant at 0 which gets 0.1. Assuming I'm following the code correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at this point we're setting the weight for any variant that we know would get more than minWeight (0.1), so this should be ok
A previous PR ensured that all variants in a "roulette" test get some share of the audience regardless of their score.
This PR refines this logic to ensure they get at least 10% of the share.