Exemplo n.º 1
0
def test_real_by_unit(dao, unit_type):
    experiment = Experiment(
        'test-real-valued',
        'a',
        [
            Metric(
                2,
                'Average Bookings',
                'value(test_unit_type.unit.conversion)',
                'count(test_unit_type.unit.exposure)',
            )
        ],
        [SrmCheck(1, 'SRM', 'count(test_unit_type.unit.exposure)')],
        unit_type=unit_type,
    )
    evaluate_experiment_by_unit(experiment, dao)
Exemplo n.º 2
0
def test_real_by_unit(dao, unit_type):
    experiment = Experiment(
        "test-real-valued",
        "a",
        [
            Metric(
                2,
                "Average Bookings",
                "value(test_unit_type.unit.conversion)",
                "count(test_unit_type.unit.exposure)",
            )
        ],
        [SrmCheck(1, "SRM", "count(test_unit_type.unit.exposure)")],
        unit_type=unit_type,
    )
    evaluate_experiment_by_unit(experiment, dao)
Exemplo n.º 3
0
def test_missing_data_unique_goal(dao, metrics, checks, unit_type):
    experiment = Experiment(
        "test-missing-data-unique-goal",
        "a",
        [
            Metric(
                1,
                "Unique Click-through Rate",
                "unique(test_unit_type.unit.click)",
                "count(test_unit_type.global.exposure)",
            )
        ],
        [SrmCheck(1, "SRM", "count(test_unit_type.global.exposure)")],
        unit_type=unit_type,
        variants=["a", "b"],
    )
    evaluate_experiment_agg(experiment, dao)
Exemplo n.º 4
0
def test_missing_data_unique_goal(dao, metrics, checks, unit_type):
    experiment = Experiment(
        'test-missing-data-unique-goal',
        'a',
        [
            Metric(
                1,
                'Unique Click-through Rate',
                'unique(test_unit_type.unit.click)',
                'count(test_unit_type.global.exposure)',
            )
        ],
        [SrmCheck(1, 'SRM', 'count(test_unit_type.global.exposure)')],
        unit_type=unit_type,
        variants=['a', 'b'],
    )
    evaluate_experiment_agg(experiment, dao)
Exemplo n.º 5
0
def test_degrees_of_freedom(dao, metrics, checks, unit_type):
    """Testing functions np.round() and np.trunc() used when converting degrees of freedom from float to int."""
    experiment = Experiment(
        "test-degrees-of-freedom",
        "a",
        [
            Metric(
                1,
                "Click-through Rate",
                "count(test_unit_type.unit.click)",
                "count(test_unit_type.global.exposure)",
            ),
        ],
        [SrmCheck(1, "SRM", "count(test_unit_type.global.exposure)")],
        unit_type=unit_type,
        variants=["a", "b"],
    )
    evaluate_experiment_agg(experiment, dao)
Exemplo n.º 6
0
def test_filter_scope_goal(dao, metrics, checks, unit_type):
    experiment = Experiment(
        "test-dimension",
        "a",
        [
            Metric(
                1,
                "Views per User of Screen S",
                "count(test_unit_type.unit.view)",
                "count(test_unit_type.global.exposure)",
            ),
        ],
        [SrmCheck(1, "SRM", "count(test_unit_type.global.exposure)")],
        unit_type=unit_type,
        variants=["a", "b"],
        filters=[Filter("element", ["button-1"], FilterScope.goal)],
    )
    evaluate_experiment_agg(experiment, dao)
Exemplo n.º 7
0
def test_dimension(dao, metrics, checks, unit_type):
    experiment = Experiment(
        "test-dimension",
        "a",
        [
            Metric(
                1,
                "Views per User of Screen button-1",
                "count(test_unit_type.unit.view(element=button-1))",
                "count(test_unit_type.global.exposure)",
            ),
            Metric(
                2,
                "Views per User of Screen button-%",
                "count(test_unit_type.unit.view(element=button-%))",
                "count(test_unit_type.global.exposure)",
            ),
        ],
        [SrmCheck(1, "SRM", "count(test_unit_type.global.exposure)")],
        unit_type=unit_type,
        variants=["a", "b"],
    )
    evaluate_experiment_agg(experiment, dao)
Exemplo n.º 8
0
def checks():
    return [SrmCheck(1, 'SRM', 'count(test_unit_type.global.exposure)')]
Exemplo n.º 9
0
def checks():
    return [SrmCheck(1, "SRM", "count(test_unit_type.global.exposure)")]