feat: add Split class for segmented analysis and cluster aggregation#265
Open
ludovicolc wants to merge 6 commits into
Open
feat: add Split class for segmented analysis and cluster aggregation#265ludovicolc wants to merge 6 commits into
ludovicolc wants to merge 6 commits into
Conversation
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.
This PR introduces the Split class and its default implementation DefaultSplit. This new feature allows for segmented analysis (e.g., by User Status, Market, etc.) while ensuring correct statistical treatment of clustered data.
Why was Split added? (Difference from Dimension)
The Split class was introduced to handle a specific analytical use case that Dimension does not cover:
The Core Benefit of Split:
When using a Split, the logic in HypothesisTest ensures that even if a user changes status during the experiment, the data is correctly aggregated at the cluster level before performing the inference. This prevents statistical bias and ensures that the "Total" result correctly reflects the weighted contribution of these dynamic segments.
Using Dimensions and Splits Together
The implementation allows Dimension and Split to be used simultaneously within the same AnalysisPlan.
When both are provided, the AnalysisPlan performs a nested iteration.
This enables a granular breakdown (e.g., analyzing the experiment results by Country and then further segmenting by User Status within each country). For every combination, the system correctly handles the cluster aggregation required by the Split logic while maintaining the categorical filtering of the Dimension.
Key Changes