Meridian GeoX lets you compare different methodologies during experiment design,
helping you identify the best approach for your unique marketing objectives and
study setups.

To compare among multiple methodologies such as
*time-based regression (TBR)* and pairing different geo assignment rules
such as `RANDOM` versus `STRATIFIED_SAMPLING`, you can use the
`geox.compare_designs()` function. This lets you to evaluate which approach
yields better metrics, such as a higher R-square score or a lower
*minimum detectable effect (MDE)*, on your specific dataset.

### Comparison of TBR under different assignment rules

The following snippet sets up two different configurations

- Option A: TBR with Random Assignment
- Option B: TBR with Stratified Sampling

and compares them side-by-side. Although in general, Stratified Sampling is
recommended since it works nicely with TBR and it tends to yield designs with
lower variance.

    import datetime
    import meridian_geox as geox

    # 1. Define the configurations you want to compare
    comparison_results = geox.compare_designs(
        design_data,
        [
            # Option A: TBR with Random Assignment
            (
                geox.DesignConfig(
                    experiment_duration=datetime.timedelta(days=28),
                    methodology=geox.Methodology.TBR,
                    geo_assignment_rule=geox.GeoAssignmentRule.RANDOM,
                    design_output_count=5
                ),
                geox.Constraints()
            ),
            # Option B: TBR with Stratified Sampling
            (
                geox.DesignConfig(
                    experiment_duration=datetime.timedelta(days=28),
                    methodology=geox.Methodology.TBR,
                    geo_assignment_rule=geox.GeoAssignmentRule.STRATIFIED_SAMPLING,
                    design_output_count=5
                ),
                geox.Constraints()
            ),
        ]
    )

    # 2. View the combined metrics table to see which performed better
    print("Comparing Methodology Metrics:")
    comparison_results.design_metrics