Fix combined experiments#502
Merged
andrew merged 1 commit intosplitrb:masterfrom Sep 20, 2017
semanticart:jc-combined-experiments-fix
Merged
Fix combined experiments#502andrew merged 1 commit intosplitrb:masterfrom semanticart:jc-combined-experiments-fix
andrew merged 1 commit intosplitrb:masterfrom
semanticart:jc-combined-experiments-fix
Conversation
1. always pass all alternatives to prevent unintentional version bumps 2. return the chosen alternative from `ab_combined_test` Fixes #500
semanticart
commented
Sep 19, 2017
| weighted_alternatives ||= experiment[:alternatives].each_with_object({}) do |alt, memo| | ||
| alt = Alternative.new(alt, experiment[:name]).name | ||
| memo[alt] = (alt == alternative ? 1 : 0) | ||
| end |
Contributor
Author
There was a problem hiding this comment.
If there's a better way to do this, I'm all ears.
The goal is to return an array with a hash that has each alternative with a weight of zero except the selected alternative which should have a weight of 1.
e.g. [{"control" => 0, "test-alt" => 1}]
Because experiment[:alternatives] can be a simple array or a hash of weights, I'm leaning on Alternative to normalize the name.
Member
|
LGTM 👍 |
Contributor
Author
|
Awesome 👏 Merge when ready. |
Member
|
I’ll get a new release published to rubygems tomorrow 👌 |
Contributor
|
@semanticart Thanks for fixing this |
Contributor
Author
|
@daviddening thanks for the original feature work. @andrew thanks for the new release. <3 |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ab_combined_testFixes #500