Skip to content
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

Jon/fix/experiment-config-init #4543

Merged
merged 2 commits into from
Oct 25, 2023
Merged

Conversation

Jon-edge
Copy link
Collaborator

@Jon-edge Jon-edge commented Oct 23, 2023

  • Fix experiment config disk copy management
  • Fix generateExperimentConfigVal: The logic was incorrect for checking each bucket of probabilities for 3+ variants

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Copy link
Contributor

@samholmes samholmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the probability distribution configuration to use percentages, and derive the sum as the denominator for you calculations (incase the sum doesn't add up to 100%).

@Jon-edge Jon-edge force-pushed the jon/fix/experiment-config-init branch from 802a037 to dd582a1 Compare October 23, 2023 21:59
CHANGELOG.md Outdated
@@ -7,6 +7,7 @@
- added: Paybis sell to debit card
- changed: Change FlipInput styling to make the edit functionality more obvious
- changed: Move asset-specific settings into their own settings page
- fixed: Experiment config generation for more than 2 variants
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed: Write updated experiment configs to disk and changed: Experiment config probability distribution support percentage based values

console.error(`Misconfigured experimentDistribution for: '${key}'`)
} else {
// Distribute the probability of each config value
const totalProbability = variantProbability.reduce((sum, probability) => sum + probability, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this value is a "probability" but instead a denomination, so that might be a better name because that's what it is for each probability we calculate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you are referring only to variantDenomination because total denomination makes no sense

if (totalProbability > 101 || totalProbability < 99) {
console.warn(`Config values for ${key} do not add up to 100% +/- 1%`)
}
const distributedProbabilities = variantProbability.map(probability => probability / totalProbability)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Division by zero isn't handled when it should.

@Jon-edge Jon-edge force-pushed the jon/fix/experiment-config-init branch from dd582a1 to c273f30 Compare October 25, 2023 17:41
@samholmes samholmes force-pushed the jon/fix/experiment-config-init branch from c273f30 to bebe736 Compare October 25, 2023 17:51
Copy link
Contributor

@samholmes samholmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with the added fixup

@samholmes samholmes force-pushed the jon/fix/experiment-config-init branch from bebe736 to 6dab471 Compare October 25, 2023 17:52
@Jon-edge
Copy link
Collaborator Author

/rebase

samholmes and others added 2 commits October 25, 2023 17:53
The logic was incorrect for checking each bucket of probabilities for 3+ variants
If new values were added to the experiment config, those new values weren't getting stored and the client was regenerating every time
@github-actions github-actions bot force-pushed the jon/fix/experiment-config-init branch from 6dab471 to ad8fdb9 Compare October 25, 2023 17:53
@Jon-edge Jon-edge enabled auto-merge October 25, 2023 17:57
@Jon-edge Jon-edge disabled auto-merge October 25, 2023 18:24
@Jon-edge Jon-edge merged commit 83cbf92 into develop Oct 25, 2023
1 check passed
@Jon-edge Jon-edge deleted the jon/fix/experiment-config-init branch October 25, 2023 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants