-
Notifications
You must be signed in to change notification settings - Fork 429
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
feat: Create split testing for multivariate #3235
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
@zachaysan on the whole, this is really impressive. I have gone through with quite a fine-toothed comb so there are a fair amount of comments but most of them are my lack of knowledge in the world of statistics, or a little bit nit-picky :)
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check linting[ ] I have added information todocs/
if required so people know about the feature!Changes
Edit: These changes are out of date after multiple rounds of review and now with ongoing work to pull the split testing code into it's own repository.
Overall, the changes introduced here support adding split testing to Flagsmith for the customers of ours that use the
settings.USE_POSTGRES_FOR_ANALYTICS
option, so this does not support our current SaaS method. The basic idea is that each of our multivariate options are linked into aSplitTest
model and serve as the source of identification as to which split test is represented. In detail changes include:FeatureEvaluationRaw
to accept a new identifier so we can tell when a user has encountered a feature. This has been implemented as a query param since the body of the request just has feature names. Also,FeatureEvaluationRaw
needed faster lookups so an index onfeature_name
was added concurrently as well.chi2_contingency
summary statistic that follows the G-Test version of split testing which was verified as current on Wikipedia as well as elsewhere. This comes with all ofscipy
which may be a drawback on some systems, but if there is significant issues with it we can always extract the one function we need out into its own helper.ConversionEvent
which can be called for events like new user signup, just as a normal analytics app would. This is used to track the actual split test results.SplitTest
results they are available via aSplitTestViewSet
which serializes the related attributes offeature
andmultivariate_feature_option
which reused serializers from existing areas of the codebase.How did you test this code?
Around seven or eight new tests, mostly on the new functionality. I wasn't quite happy with the split test task test since it is not deterministic and there didn't seem to be a clean way to force some identities to some multivariate options and other ones to others. Also, it would have been nice to test it with more objects, but with the size of the objects that would have been necessary, the statistics part was tested with raw numbers instead.