ab-analysis-kit 0.6.0__tar.gz → 0.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ab_analysis_kit-0.6.0/ab_analysis_kit.egg-info → ab_analysis_kit-0.6.2}/PKG-INFO +12 -8
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/README.md +11 -7
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2/ab_analysis_kit.egg-info}/PKG-INFO +12 -8
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/__init__.py +1 -1
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/rules/plan.md +22 -10
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/skills/abk-plan/SKILL.md +15 -8
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/plan.py +260 -11
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/main.py +9 -1
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/compute/recompute_backend.py +45 -1
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/loaders/exposure_source.py +23 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/loaders/query_template.py +24 -1
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/loaders/templates/abkit_assignment.jinja +5 -1
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/planning/sizing.py +152 -21
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/power.py +3 -3
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/LICENSE +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/MANIFEST.in +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/ab_analysis_kit.egg-info/SOURCES.txt +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/ab_analysis_kit.egg-info/dependency_links.txt +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/ab_analysis_kit.egg-info/entry_points.txt +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/ab_analysis_kit.egg-info/requires.txt +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/ab_analysis_kit.egg-info/top_level.txt +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/_output.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/CLAUDE.section.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/rules/cli.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/rules/experiments.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/rules/explore.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/rules/methods.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/rules/metrics.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/rules/overview.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/rules/project.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/rules/validate.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/skills/abk-explore/SKILL.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/skills/abk-feedback/SKILL.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/skills/abk-new-experiment/SKILL.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/skills/abk-new-metric/SKILL.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/skills/abk-setup-project/SKILL.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/skills/abk-validate/SKILL.md +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/_context.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/clean.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/dashboard.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/explore.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/init.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/init_claude.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/run.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/test_report.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/unlock.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/validate.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/commands/verify_incremental.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/compute/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/compute/incremental_backend.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/compute/reconcile.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/config/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/config/discovery.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/config/experiment_config.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/config/method_config.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/config/metric_config.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/config/profile.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/config/project_config.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/config/validator.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/core/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/core/exposure_counting.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/core/interval.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/core/models.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/core/period_planner.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/_sql_manager.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/clickhouse_manager.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/_aa_runs.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/_base.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/_experiments.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/_exposures.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/_maintenance.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/_results.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/_schema.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/_tasks.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/_unit_state.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/internal_tables/manager.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/manager.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/mysql_manager.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/postgres_manager.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/database/tables.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/loaders/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/loaders/exposure_copy.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/loaders/exposure_loader.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/loaders/metric_loader.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/loaders/state_loader.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/notify/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/notify/base.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/notify/branding.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/notify/email.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/notify/factory.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/notify/mattermost.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/notify/mock.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/notify/slack.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/notify/telegram.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/notify/webhook.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/pipeline/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/pipeline/_types.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/pipeline/analyze.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/pipeline/driver.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/pipeline/enrich.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/pipeline/readout.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/pipeline/state.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/planning/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/reporting/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/reporting/assets/report.js +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/reporting/builder.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/reporting/calibration.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/reporting/html_report.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/accumulate.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/base.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/bootstrap/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/bootstrap/applier.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/bootstrap/bootstrap.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/bootstrap/ci.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/bootstrap/engine.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/bootstrap/paired_bootstrap.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/bootstrap/paired_post_normed_bootstrap.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/bootstrap/poisson_bootstrap.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/bootstrap/post_normed_bootstrap.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/correction.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/effects.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/exceptions.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/factory.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/parametric/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/parametric/cuped_ttest.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/parametric/paired_cuped_ttest.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/parametric/paired_ttest.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/parametric/ratio_delta.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/parametric/ttest.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/parametric/ztest.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/registry.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/result.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/rng.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/samples.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/sequential/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/sequential/apply.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/sequential/confidence_sequence.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/sequential/mixture.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/stats/srm.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/assets/dashboard.js +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/assets/explore.js +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/config_writer.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/dashboard_server.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/html.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/jobs.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/overview.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/payload.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/recompute.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/server.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/tuning/session.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/utils/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/utils/datetime_utils.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/utils/env_interpolation.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/utils/json_utils.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/utils/warn_scope.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/__init__.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/_types.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/family.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/inject.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/load.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/panel.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/persistence.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/resample.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/result.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/run_id.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/runner.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/scoring.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/validate/vector_resample.py +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/pyproject.toml +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/requirements.txt +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/setup.cfg +0 -0
- {ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ab-analysis-kit
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: A/B experiment analysis as declarative YAML + SQL
|
|
5
5
|
Author: ab-analysis-kit authors
|
|
6
6
|
License: MIT
|
|
@@ -76,14 +76,19 @@ stabilization chart), writes them to a clean warehouse table any BI can read, an
|
|
|
76
76
|
gives you a local cockpit to tune the analysis and a harness to prove your method is
|
|
77
77
|
actually calibrated.
|
|
78
78
|
|
|
79
|
-
> **Status: `0.6.
|
|
80
|
-
> (milestones **M1–M11** shipped — M11
|
|
79
|
+
> **Status: `0.6.2` (Alpha) — release-ready; `0.6.1` is the latest on PyPI**
|
|
80
|
+
> (milestones **M1–M11** shipped — M11 added **`abk dashboard`**, the
|
|
81
81
|
> project-level cockpit: one row per experiment with its headline verdict,
|
|
82
82
|
> effect + CI, p/α and a sparkline of the cumulative series, plus buttons that
|
|
83
83
|
> spawn real `abk` subprocesses (Run — for the whole experiment or one metric —
|
|
84
84
|
> Unlock, Clean, Explore, Open report) and stream their logs. It is a
|
|
85
85
|
> **launcher**: it computes no statistic and never takes the pipeline lock, so
|
|
86
|
-
> every verdict on the page is the readout's own
|
|
86
|
+
> every verdict on the page is the readout's own. The `0.6.x` interstitial then
|
|
87
|
+
> closed both `abk plan` sizing gaps: a CUPED comparison is sized on the covariate
|
|
88
|
+
> correlation its own results row already persists — required-N is `(1 − ρ²)×` the
|
|
89
|
+
> old raw-variance bound (`0.6.1`) — and `--from-history <N d>` gives an experiment
|
|
90
|
+
> that has **never run** a baseline from the days before its start, instead of
|
|
91
|
+
> `SKIPPED: no baseline` (`0.6.2`)). The statistical core, the
|
|
87
92
|
> declarative config / DB / pipeline layer, the explore cockpit +
|
|
88
93
|
> self-contained reports, `abk validate` (numpy-vectorized — minutes → sub-seconds),
|
|
89
94
|
> opt-in sequential analysis + `abk plan`, and the DX layer (`abk init-claude`, docs site,
|
|
@@ -96,10 +101,9 @@ pip install ab-analysis-kit # Python 3.10+; add a DB extra for real dat
|
|
|
96
101
|
pip install "ab-analysis-kit[clickhouse]" # or [postgres] / [mysql] / [all-db]
|
|
97
102
|
```
|
|
98
103
|
|
|
99
|
-
(`0.6.
|
|
100
|
-
`
|
|
101
|
-
|
|
102
|
-
source: `pip install -e ".[dev]"`.)
|
|
104
|
+
(`pip install ab-analysis-kit` gets `0.6.1` — `abk dashboard` and CUPED-aware
|
|
105
|
+
`abk plan` sizing included. `0.6.2`'s `abk plan --from-history` lands with its tag;
|
|
106
|
+
until then install from source for it: `pip install -e ".[dev]"`.)
|
|
103
107
|
|
|
104
108
|
`abk --version` and `abk --help` work with no database driver; you can even lint a
|
|
105
109
|
config (`abk run --steps validate`) with no database at all. See the
|
|
@@ -11,14 +11,19 @@ stabilization chart), writes them to a clean warehouse table any BI can read, an
|
|
|
11
11
|
gives you a local cockpit to tune the analysis and a harness to prove your method is
|
|
12
12
|
actually calibrated.
|
|
13
13
|
|
|
14
|
-
> **Status: `0.6.
|
|
15
|
-
> (milestones **M1–M11** shipped — M11
|
|
14
|
+
> **Status: `0.6.2` (Alpha) — release-ready; `0.6.1` is the latest on PyPI**
|
|
15
|
+
> (milestones **M1–M11** shipped — M11 added **`abk dashboard`**, the
|
|
16
16
|
> project-level cockpit: one row per experiment with its headline verdict,
|
|
17
17
|
> effect + CI, p/α and a sparkline of the cumulative series, plus buttons that
|
|
18
18
|
> spawn real `abk` subprocesses (Run — for the whole experiment or one metric —
|
|
19
19
|
> Unlock, Clean, Explore, Open report) and stream their logs. It is a
|
|
20
20
|
> **launcher**: it computes no statistic and never takes the pipeline lock, so
|
|
21
|
-
> every verdict on the page is the readout's own
|
|
21
|
+
> every verdict on the page is the readout's own. The `0.6.x` interstitial then
|
|
22
|
+
> closed both `abk plan` sizing gaps: a CUPED comparison is sized on the covariate
|
|
23
|
+
> correlation its own results row already persists — required-N is `(1 − ρ²)×` the
|
|
24
|
+
> old raw-variance bound (`0.6.1`) — and `--from-history <N d>` gives an experiment
|
|
25
|
+
> that has **never run** a baseline from the days before its start, instead of
|
|
26
|
+
> `SKIPPED: no baseline` (`0.6.2`)). The statistical core, the
|
|
22
27
|
> declarative config / DB / pipeline layer, the explore cockpit +
|
|
23
28
|
> self-contained reports, `abk validate` (numpy-vectorized — minutes → sub-seconds),
|
|
24
29
|
> opt-in sequential analysis + `abk plan`, and the DX layer (`abk init-claude`, docs site,
|
|
@@ -31,10 +36,9 @@ pip install ab-analysis-kit # Python 3.10+; add a DB extra for real dat
|
|
|
31
36
|
pip install "ab-analysis-kit[clickhouse]" # or [postgres] / [mysql] / [all-db]
|
|
32
37
|
```
|
|
33
38
|
|
|
34
|
-
(`0.6.
|
|
35
|
-
`
|
|
36
|
-
|
|
37
|
-
source: `pip install -e ".[dev]"`.)
|
|
39
|
+
(`pip install ab-analysis-kit` gets `0.6.1` — `abk dashboard` and CUPED-aware
|
|
40
|
+
`abk plan` sizing included. `0.6.2`'s `abk plan --from-history` lands with its tag;
|
|
41
|
+
until then install from source for it: `pip install -e ".[dev]"`.)
|
|
38
42
|
|
|
39
43
|
`abk --version` and `abk --help` work with no database driver; you can even lint a
|
|
40
44
|
config (`abk run --steps validate`) with no database at all. See the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ab-analysis-kit
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: A/B experiment analysis as declarative YAML + SQL
|
|
5
5
|
Author: ab-analysis-kit authors
|
|
6
6
|
License: MIT
|
|
@@ -76,14 +76,19 @@ stabilization chart), writes them to a clean warehouse table any BI can read, an
|
|
|
76
76
|
gives you a local cockpit to tune the analysis and a harness to prove your method is
|
|
77
77
|
actually calibrated.
|
|
78
78
|
|
|
79
|
-
> **Status: `0.6.
|
|
80
|
-
> (milestones **M1–M11** shipped — M11
|
|
79
|
+
> **Status: `0.6.2` (Alpha) — release-ready; `0.6.1` is the latest on PyPI**
|
|
80
|
+
> (milestones **M1–M11** shipped — M11 added **`abk dashboard`**, the
|
|
81
81
|
> project-level cockpit: one row per experiment with its headline verdict,
|
|
82
82
|
> effect + CI, p/α and a sparkline of the cumulative series, plus buttons that
|
|
83
83
|
> spawn real `abk` subprocesses (Run — for the whole experiment or one metric —
|
|
84
84
|
> Unlock, Clean, Explore, Open report) and stream their logs. It is a
|
|
85
85
|
> **launcher**: it computes no statistic and never takes the pipeline lock, so
|
|
86
|
-
> every verdict on the page is the readout's own
|
|
86
|
+
> every verdict on the page is the readout's own. The `0.6.x` interstitial then
|
|
87
|
+
> closed both `abk plan` sizing gaps: a CUPED comparison is sized on the covariate
|
|
88
|
+
> correlation its own results row already persists — required-N is `(1 − ρ²)×` the
|
|
89
|
+
> old raw-variance bound (`0.6.1`) — and `--from-history <N d>` gives an experiment
|
|
90
|
+
> that has **never run** a baseline from the days before its start, instead of
|
|
91
|
+
> `SKIPPED: no baseline` (`0.6.2`)). The statistical core, the
|
|
87
92
|
> declarative config / DB / pipeline layer, the explore cockpit +
|
|
88
93
|
> self-contained reports, `abk validate` (numpy-vectorized — minutes → sub-seconds),
|
|
89
94
|
> opt-in sequential analysis + `abk plan`, and the DX layer (`abk init-claude`, docs site,
|
|
@@ -96,10 +101,9 @@ pip install ab-analysis-kit # Python 3.10+; add a DB extra for real dat
|
|
|
96
101
|
pip install "ab-analysis-kit[clickhouse]" # or [postgres] / [mysql] / [all-db]
|
|
97
102
|
```
|
|
98
103
|
|
|
99
|
-
(`0.6.
|
|
100
|
-
`
|
|
101
|
-
|
|
102
|
-
source: `pip install -e ".[dev]"`.)
|
|
104
|
+
(`pip install ab-analysis-kit` gets `0.6.1` — `abk dashboard` and CUPED-aware
|
|
105
|
+
`abk plan` sizing included. `0.6.2`'s `abk plan --from-history` lands with its tag;
|
|
106
|
+
until then install from source for it: `pip install -e ".[dev]"`.)
|
|
103
107
|
|
|
104
108
|
`abk --version` and `abk --help` work with no database driver; you can even lint a
|
|
105
109
|
config (`abk run --steps validate`) with no database at all. See the
|
|
@@ -10,7 +10,7 @@ from __future__ import annotations
|
|
|
10
10
|
|
|
11
11
|
from typing import Any
|
|
12
12
|
|
|
13
|
-
__version__ = "0.6.
|
|
13
|
+
__version__ = "0.6.2"
|
|
14
14
|
|
|
15
15
|
#: Symbols re-exported lazily from ``abkit.stats`` (PEP 562) so importing
|
|
16
16
|
#: ``abkit`` for ``__version__`` (the CLI path) stays numpy-free and fast.
|
|
@@ -26,14 +26,19 @@ from the *same* grid enumeration the pipeline uses.
|
|
|
26
26
|
|
|
27
27
|
Sizing needs per-arm moments (mean+std for `sample`, proportion for `fraction`):
|
|
28
28
|
|
|
29
|
-
1. **
|
|
29
|
+
1. **`--baseline` override** (wins) — for a greenfield experiment with no data yet.
|
|
30
|
+
Grammar: `<metric>:mean=..,std=..,n=..` (sample) or `<metric>:prop=..,n=..`
|
|
31
|
+
(fraction). Optional `n_other=..` sets the treatment arm (defaults to `n`);
|
|
32
|
+
optional `corr=..` sizes CUPED.
|
|
33
|
+
2. **`--from-history <N d>`** — the N whole days before the start, for an experiment
|
|
34
|
+
that has never run. **Population-wide** (there is no cohort yet), so `n` counts
|
|
35
|
+
everyone the metric SQL yields and `assignment.added_filters` cannot be applied —
|
|
36
|
+
both stated on the line. Tell the user it is indicative, not the experiment's own.
|
|
37
|
+
3. **Persisted** — the latest usable `_ab_results` row for the control/first-
|
|
30
38
|
treatment pair (source shown as `persisted @ <ts>`). Requires at least one
|
|
31
39
|
`abk run` to have landed.
|
|
32
|
-
2. **`--baseline` override** — for a greenfield experiment with no data yet.
|
|
33
|
-
Grammar: `<metric>:mean=..,std=..,n=..` (sample) or `<metric>:prop=..,n=..`
|
|
34
|
-
(fraction). Optional `n_other=..` sets the treatment arm (defaults to `n`).
|
|
35
40
|
|
|
36
|
-
Without
|
|
41
|
+
Without any of them, that comparison is reported **un-sizable — not guessed**. The
|
|
37
42
|
**target MDE** defaults to the comparison's `min_effect` (override with `--mde`).
|
|
38
43
|
|
|
39
44
|
## Flags
|
|
@@ -46,6 +51,7 @@ Without either, that comparison is reported **un-sizable — not guessed**. The
|
|
|
46
51
|
| `--power 0.8` | Target power. Default: the project statistics default. |
|
|
47
52
|
| `--alpha 0.05` | Experiment-level alpha *before* correction; the two-tier scheme still divides it. Default: experiment/project alpha. |
|
|
48
53
|
| `--baseline <spec>` | Greenfield baseline moments (repeatable; see above). |
|
|
54
|
+
| `--from-history <N d>` | Population baselines from the N whole days before the start (see above). |
|
|
49
55
|
| `--arrival-rate <units/day>` | Total units/day across arms, for the **runtime** (days-to-required-N) + always-valid **ASN** estimates. Default: derived read-only from the cohort source — the persisted `_ab_exposures` copy under `assignment.cohort_copy.enabled`, otherwise (the default) a fresh snapshot of the live assignment source re-executed at invocation time (the documented no-copy cost/freshness tradeoff); without arrival data both are skipped. Must be `> 0`. |
|
|
50
56
|
| `--profile` | Profile name (default: `profiles.yml` `default_profile`). |
|
|
51
57
|
|
|
@@ -60,10 +66,15 @@ power formula:
|
|
|
60
66
|
`abk validate --inject-effect` instead → SKIPPED.
|
|
61
67
|
- **paired** designs — SKIPPED.
|
|
62
68
|
|
|
63
|
-
**CUPED** (`cuped-t-test`)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
**CUPED** (`cuped-t-test`) is sized on its **own covariate correlation**: rows have
|
|
70
|
+
persisted `corr_coef_1/2` since `0.4.0`, so required-N is `(1 − ρ²)×` the
|
|
71
|
+
raw-variance number and the note names the ρ it used. Three cases fall back to the
|
|
72
|
+
raw variance, each saying which: **no ρ on the row** (written before `0.4.0` — the
|
|
73
|
+
number is then a conservative upper bound), **ρ = 0** (a measurement: this covariate
|
|
74
|
+
reduces nothing), and **`1 − ρ² < 1e-12`** (the covariate reproduces the metric — a
|
|
75
|
+
leak or a synthetic fixture; a deflated N would be rounding noise). Pass
|
|
76
|
+
`corr=` inside `--baseline` to size a never-run experiment; it is accepted only on a
|
|
77
|
+
comparison whose method actually applies a covariate.
|
|
67
78
|
|
|
68
79
|
## Reading the output
|
|
69
80
|
|
|
@@ -78,7 +89,8 @@ than crashing the plan.
|
|
|
78
89
|
│ target MDE 5.00% → required 25,580/arm ✗ underpowered · power@MDE 0.06 · achievable MDE 49.26%
|
|
79
90
|
│ example_arpu [secondary · cuped-t-test · relative] — baseline mean=62.86 std=42 · n=300/300 (persisted @ …)
|
|
80
91
|
│ target MDE 5.00% → required 2,804/arm ✗ underpowered · power@MDE 0.15 · achievable MDE 15.31%
|
|
81
|
-
│ ⚠ sized on RAW variance —
|
|
92
|
+
│ ⚠ sized on RAW variance — ρ = 1 leaves no usable residual variance (the covariate
|
|
93
|
+
│ reproduces the metric), so a deflated required-N would be rounding noise
|
|
82
94
|
└─ looks: 14 planned · cadence 1d · horizon 2024-07-15 · ~28 _ab_results rows/full-refresh
|
|
83
95
|
```
|
|
84
96
|
|
{ab_analysis_kit-0.6.0 → ab_analysis_kit-0.6.2}/abkit/cli/assets/claude/skills/abk-plan/SKILL.md
RENAMED
|
@@ -59,6 +59,7 @@ Flags (confirm the live set with `abk plan --help`):
|
|
|
59
59
|
| `--power` | Target power (default: `statistics.power`, typically 0.8) |
|
|
60
60
|
| `--alpha` | Experiment-level significance **before** correction (default: experiment/project alpha) |
|
|
61
61
|
| `--baseline` | Baseline moments for a metric with no data (repeatable — Step 2) |
|
|
62
|
+
| `--from-history <N d>` | Population baselines from the N whole days before the start — the pre-launch source (loses to `--baseline`, wins over persisted) |
|
|
62
63
|
| `--arrival-rate` | Total units/day across arms, for the runtime (days-to-N) + always-valid ASN estimates (default: derived read-only from the cohort source — the persisted `_ab_exposures` copy in copy mode, otherwise a fresh re-execution of the live assignment SQL at invocation time; must be `> 0`) |
|
|
63
64
|
| `--profile` | Profile name (default: `profiles.yml` `default_profile`) |
|
|
64
65
|
|
|
@@ -94,8 +95,8 @@ Per comparison the tree prints a line like:
|
|
|
94
95
|
|
|
95
96
|
```
|
|
96
97
|
arpu [main · cuped-t-test · relative] — baseline mean=12.5 std=8 · n=5000/5000 (persisted @ 2024-07-14…)
|
|
97
|
-
target MDE 3.00% → required
|
|
98
|
-
⚠ sized on
|
|
98
|
+
target MDE 3.00% → required 5,885/arm ✗ underpowered · power@MDE 0.73 · achievable MDE 3.25%
|
|
99
|
+
⚠ sized on CUPED-deflated variance (ρ = 0.42) — required-N is 0.824× the raw-variance bound
|
|
99
100
|
```
|
|
100
101
|
|
|
101
102
|
Interpret it:
|
|
@@ -124,12 +125,18 @@ is omitted and only the achievable MDE is shown — pass `--mde` or set `min_eff
|
|
|
124
125
|
| **ratio metric** | No versioned closed-form power formula for `ratio-delta` | Size a related `sample`/`fraction` proxy, or measure empirically |
|
|
125
126
|
| **resampling method** | Bootstrap methods have no closed-form power | Measure it with `abk validate --inject-effect` (empirical power) |
|
|
126
127
|
| **paired design** | Paired methods aren't sized here | Size the unpaired analogue as a bound |
|
|
127
|
-
| **no baseline** | No persisted rows and no `--
|
|
128
|
-
|
|
129
|
-
**CUPED
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
| **no baseline** | No persisted rows, no `--baseline` and no `--from-history` | Run `abk run` first, pass `--baseline` (Step 2), or `--from-history 14d` for a population baseline |
|
|
129
|
+
|
|
130
|
+
**CUPED sizing (0.6.x):** a `cuped-t-test` is sized on its **own** covariate
|
|
131
|
+
correlation — rows have persisted `corr_coef_1/2` since `0.4.0` — so required-N is
|
|
132
|
+
`(1 − ρ²)×` the raw-variance number and the note names the ρ. Read the fallback notes
|
|
133
|
+
literally, they mean different things: *no ρ on the row* (a pre-`0.4.0` row ⇒ the
|
|
134
|
+
number is a conservative upper bound, tell the user the true requirement is lower),
|
|
135
|
+
*ρ = 0* (a real measurement — this covariate reduces nothing), and *ρ leaves no usable
|
|
136
|
+
residual variance* (the covariate reproduces the metric — a leak or a synthetic
|
|
137
|
+
fixture; investigate the covariate rather than trusting either number). For a never-run
|
|
138
|
+
experiment you can supply it: `--baseline <metric>:mean=..,std=..,n=..,corr=0.6` —
|
|
139
|
+
accepted only on a comparison whose method actually applies a covariate.
|
|
133
140
|
|
|
134
141
|
## Step 5 — Act on the result
|
|
135
142
|
|
|
@@ -10,9 +10,10 @@ achieved-power at the effective two-tier alpha.
|
|
|
10
10
|
Strictly read-only (D11): no lock, no ``_ab_*`` writes; its own manager is closed in a
|
|
11
11
|
``finally``. Honest refusals (D10): ratio metrics and resampling (bootstrap) methods
|
|
12
12
|
have no versioned power formula → SKIPPED with a reason, never sized with invented math;
|
|
13
|
-
CUPED is sized on the
|
|
14
|
-
|
|
15
|
-
warehouse error) exits non-zero; a
|
|
13
|
+
CUPED is sized on the variance its own persisted ``corr_coef_1`` deflates (PLAN-1), and
|
|
14
|
+
the plan line always names which variance that was — raw or deflated, and why. A genuine
|
|
15
|
+
harness failure (bad selection / ``--baseline`` / warehouse error) exits non-zero; a
|
|
16
|
+
by-design refusal does not.
|
|
16
17
|
|
|
17
18
|
Runtime / ASN (WP-A, m6-implementation-plan.md): each sizable comparison also reports
|
|
18
19
|
days-to-required-N from a unit-arrival rate (derived read-only from the cohort source —
|
|
@@ -26,6 +27,7 @@ from __future__ import annotations
|
|
|
26
27
|
|
|
27
28
|
import math
|
|
28
29
|
from datetime import date, datetime, time
|
|
30
|
+
from typing import Any
|
|
29
31
|
|
|
30
32
|
import click
|
|
31
33
|
|
|
@@ -37,6 +39,7 @@ from abkit.pipeline import comparison_alpha, effective_alphas
|
|
|
37
39
|
from abkit.planning.sizing import (
|
|
38
40
|
FRACTION,
|
|
39
41
|
SAMPLE,
|
|
42
|
+
SUSPICIOUS_RESIDUAL_VARIANCE_SHARE,
|
|
40
43
|
AsnResult,
|
|
41
44
|
BaselineMoments,
|
|
42
45
|
ComparisonPlan,
|
|
@@ -58,6 +61,7 @@ def run_plan(
|
|
|
58
61
|
power: float | None,
|
|
59
62
|
alpha: float | None,
|
|
60
63
|
baseline: tuple[str, ...],
|
|
64
|
+
from_history: str | None,
|
|
61
65
|
arrival_rate: float | None,
|
|
62
66
|
profile: str | None,
|
|
63
67
|
) -> None:
|
|
@@ -78,6 +82,8 @@ def run_plan(
|
|
|
78
82
|
overrides = parse_baseline_overrides(baseline)
|
|
79
83
|
except ValueError as exc:
|
|
80
84
|
raise click.BadParameter(str(exc), param_hint="--baseline") from exc
|
|
85
|
+
if from_history is not None:
|
|
86
|
+
_validate_history_interval(from_history)
|
|
81
87
|
|
|
82
88
|
selected, selection_warnings = select_experiments(context.root, select)
|
|
83
89
|
for warning in selection_warnings:
|
|
@@ -90,7 +96,16 @@ def run_plan(
|
|
|
90
96
|
for _, experiment in selected:
|
|
91
97
|
try:
|
|
92
98
|
_plan_one(
|
|
93
|
-
experiment,
|
|
99
|
+
experiment,
|
|
100
|
+
context,
|
|
101
|
+
profile,
|
|
102
|
+
metric,
|
|
103
|
+
mde,
|
|
104
|
+
power,
|
|
105
|
+
alpha,
|
|
106
|
+
overrides,
|
|
107
|
+
from_history,
|
|
108
|
+
arrival_rate,
|
|
94
109
|
)
|
|
95
110
|
except click.ClickException:
|
|
96
111
|
raise
|
|
@@ -112,6 +127,7 @@ def _plan_one(
|
|
|
112
127
|
power_opt,
|
|
113
128
|
alpha_opt,
|
|
114
129
|
overrides,
|
|
130
|
+
from_history,
|
|
115
131
|
arrival_rate,
|
|
116
132
|
) -> None:
|
|
117
133
|
from abkit.database.internal_tables import InternalTablesManager
|
|
@@ -163,6 +179,11 @@ def _plan_one(
|
|
|
163
179
|
rate_control, rate_source = _resolve_arrival_rate(
|
|
164
180
|
experiment, arrival_rate, tables, manager, context.root, grid
|
|
165
181
|
)
|
|
182
|
+
history = (
|
|
183
|
+
_HistoryBaselines(experiment, context, manager, grid, from_history)
|
|
184
|
+
if from_history is not None
|
|
185
|
+
else None
|
|
186
|
+
)
|
|
166
187
|
for comparison in comparisons:
|
|
167
188
|
plans.append(
|
|
168
189
|
_plan_comparison(
|
|
@@ -177,6 +198,7 @@ def _plan_one(
|
|
|
177
198
|
rate_source,
|
|
178
199
|
look_days,
|
|
179
200
|
horizon_days,
|
|
201
|
+
history,
|
|
180
202
|
)
|
|
181
203
|
)
|
|
182
204
|
finally:
|
|
@@ -284,6 +306,7 @@ def _plan_comparison(
|
|
|
284
306
|
rate_source: str = "",
|
|
285
307
|
look_days: list[float] | None = None,
|
|
286
308
|
horizon_days: float = 0.0,
|
|
309
|
+
history: _HistoryBaselines | None = None,
|
|
287
310
|
) -> ComparisonPlan:
|
|
288
311
|
role = (
|
|
289
312
|
"main"
|
|
@@ -322,14 +345,14 @@ def _plan_comparison(
|
|
|
322
345
|
target_mde = mde if mde is not None else comparison.min_effect
|
|
323
346
|
|
|
324
347
|
notes: list[str] = []
|
|
325
|
-
moments = _resolve_moments(experiment, comparison, kind, override, tables, notes)
|
|
348
|
+
moments = _resolve_moments(experiment, comparison, kind, override, tables, notes, history)
|
|
326
349
|
if moments is None:
|
|
350
|
+
refusal = _no_baseline_refusal(comparison, history)
|
|
327
351
|
return ComparisonPlan(
|
|
328
352
|
comparison.metric,
|
|
329
353
|
method_name,
|
|
330
354
|
role,
|
|
331
|
-
refused=
|
|
332
|
-
f"--baseline {comparison.metric}:...",
|
|
355
|
+
refused=refusal,
|
|
333
356
|
kind=kind,
|
|
334
357
|
test_type=test_type,
|
|
335
358
|
alpha=alpha,
|
|
@@ -337,7 +360,7 @@ def _plan_comparison(
|
|
|
337
360
|
target_mde=target_mde,
|
|
338
361
|
)
|
|
339
362
|
if method_cls.requires_covariate:
|
|
340
|
-
notes.append(
|
|
363
|
+
notes.append(_covariate_note(moments))
|
|
341
364
|
|
|
342
365
|
plan_ratio = _plan_ratio(experiment)
|
|
343
366
|
result = size_comparison(
|
|
@@ -453,19 +476,240 @@ def _plan_ratio(experiment) -> float:
|
|
|
453
476
|
return 1.0
|
|
454
477
|
|
|
455
478
|
|
|
479
|
+
class _HistoryBaselines:
|
|
480
|
+
"""`--from-history`: population moments from the N whole days before the start.
|
|
481
|
+
|
|
482
|
+
Sizing needs per-unit moments, and before PLAN-2 they came only from a previous
|
|
483
|
+
``abk run`` of this same experiment or a hand-typed ``--baseline`` — so the
|
|
484
|
+
pre-launch case, the one planning is actually for, read ``SKIPPED: no baseline``.
|
|
485
|
+
|
|
486
|
+
The read is deliberately POPULATION-wide: an experiment that has not launched has
|
|
487
|
+
no cohort to join, so the render measures everything the metric SQL yields over
|
|
488
|
+
``[tz-midnight(start − interval), tz-midnight(start))``. That is a strictly better
|
|
489
|
+
input than a guess and strictly worse than a pilot run — the plan line says so,
|
|
490
|
+
especially when ``assignment.added_filters`` narrows the real cohort.
|
|
491
|
+
|
|
492
|
+
Lazy and cached per metric: a plan touches each metric once, and a comparison that
|
|
493
|
+
refuses (ratio/bootstrap) must not pay for a render it will never use.
|
|
494
|
+
"""
|
|
495
|
+
|
|
496
|
+
def __init__(
|
|
497
|
+
self, experiment: Any, context: Any, manager: Any, grid: Any, interval: str
|
|
498
|
+
) -> None:
|
|
499
|
+
self._experiment = experiment
|
|
500
|
+
self._context = context
|
|
501
|
+
self._manager = manager
|
|
502
|
+
self._grid = grid
|
|
503
|
+
self.interval = interval
|
|
504
|
+
self._backend: Any = None
|
|
505
|
+
self._cache: dict[str, BaselineMoments | None] = {}
|
|
506
|
+
self.failures: dict[str, str] = {}
|
|
507
|
+
|
|
508
|
+
@property
|
|
509
|
+
def label(self) -> str:
|
|
510
|
+
return f"history {self.interval}"
|
|
511
|
+
|
|
512
|
+
def moments(self, comparison: Any, kind: str) -> BaselineMoments | None:
|
|
513
|
+
"""Population moments for one comparison, or ``None`` with a recorded reason.
|
|
514
|
+
|
|
515
|
+
A render failure refuses THAT comparison (the caller turns it into a SKIPPED
|
|
516
|
+
line naming the reason) rather than failing the command: one unreadable metric
|
|
517
|
+
must not cost the whole plan (the same discipline the row shaper uses).
|
|
518
|
+
"""
|
|
519
|
+
metric_name = comparison.metric
|
|
520
|
+
if metric_name in self._cache:
|
|
521
|
+
return self._cache[metric_name]
|
|
522
|
+
try:
|
|
523
|
+
moments = self._load(metric_name, kind)
|
|
524
|
+
except Exception as exc: # a render/SQL/shape failure on ONE metric
|
|
525
|
+
self.failures[metric_name] = str(exc)
|
|
526
|
+
moments = None
|
|
527
|
+
self._cache[metric_name] = moments
|
|
528
|
+
return moments
|
|
529
|
+
|
|
530
|
+
def _load(self, metric_name: str, kind: str) -> BaselineMoments | None:
|
|
531
|
+
from abkit.loaders.exposure_source import build_population_backend
|
|
532
|
+
from abkit.loaders.query_template import POPULATION_VARIANT
|
|
533
|
+
from abkit.pipeline.analyze import build_container
|
|
534
|
+
|
|
535
|
+
metric = self._context.metrics_by_name.get(metric_name)
|
|
536
|
+
if metric is None:
|
|
537
|
+
raise ValueError(f"metric '{metric_name}' is not in the library")
|
|
538
|
+
if self._backend is None:
|
|
539
|
+
self._backend = build_population_backend(self._manager, self._experiment)
|
|
540
|
+
loaded = self._backend.load_population_window(
|
|
541
|
+
metric, metric.get_query_text(self._context.root), self.interval, self._grid
|
|
542
|
+
)
|
|
543
|
+
if POPULATION_VARIANT not in loaded.variants():
|
|
544
|
+
raise ValueError("the history window returned no rows")
|
|
545
|
+
# The pipeline's OWN container → suffstats path, never a hand-rolled np.std:
|
|
546
|
+
# `_ab_results.std_1` carries the legacy mixed-ddof convention, and two baseline
|
|
547
|
+
# sources that disagreed by a ddof would be quietly incomparable.
|
|
548
|
+
container = build_container(kind, POPULATION_VARIANT, loaded)
|
|
549
|
+
source = f"{self.label} @ {self._experiment.name}"
|
|
550
|
+
if kind == FRACTION:
|
|
551
|
+
return BaselineMoments(
|
|
552
|
+
FRACTION, container.prop, container.nobs, container.nobs, None, source
|
|
553
|
+
)
|
|
554
|
+
from abkit.stats import SufficientStats
|
|
555
|
+
|
|
556
|
+
stats = SufficientStats.from_sample(container)
|
|
557
|
+
if stats.sample_size < 2 or not stats.std > 0:
|
|
558
|
+
raise ValueError(
|
|
559
|
+
f"the history window yielded {stats.sample_size} unit(s) with no spread"
|
|
560
|
+
)
|
|
561
|
+
return BaselineMoments(
|
|
562
|
+
SAMPLE,
|
|
563
|
+
stats.mean,
|
|
564
|
+
float(stats.sample_size),
|
|
565
|
+
float(stats.sample_size),
|
|
566
|
+
stats.std,
|
|
567
|
+
source,
|
|
568
|
+
)
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
def _history_notes(experiment: Any, history: _HistoryBaselines) -> list[str]:
|
|
572
|
+
"""What a population baseline is NOT, said on the line that uses it."""
|
|
573
|
+
notes = [
|
|
574
|
+
f"baseline from the {history.interval} before the start — POPULATION-wide "
|
|
575
|
+
"(the experiment has no cohort to read yet), so `n` counts everyone the metric "
|
|
576
|
+
"SQL yields, not the units this experiment will enroll"
|
|
577
|
+
]
|
|
578
|
+
if experiment.assignment.added_filters:
|
|
579
|
+
notes.append(
|
|
580
|
+
"assignment.added_filters narrows the real cohort, and a population read "
|
|
581
|
+
"cannot apply it — treat this variance as indicative, not as this "
|
|
582
|
+
"experiment's own"
|
|
583
|
+
)
|
|
584
|
+
return notes
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
def _no_baseline_refusal(comparison: Any, history: _HistoryBaselines | None) -> str:
|
|
588
|
+
"""The SKIPPED reason, naming the history render's own failure when there was one."""
|
|
589
|
+
if history is not None and comparison.metric in history.failures:
|
|
590
|
+
return (
|
|
591
|
+
f"no baseline — the {history.label} render failed: "
|
|
592
|
+
f"{history.failures[comparison.metric]}"
|
|
593
|
+
)
|
|
594
|
+
hint = "" if history is not None else ", or pass --from-history <N d>"
|
|
595
|
+
return "no baseline — run `abk run` first, or pass " f"--baseline {comparison.metric}:...{hint}"
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
def _validate_history_interval(raw: str) -> None:
|
|
599
|
+
"""`--from-history` is whole days — the grain `covariate_lookback` already uses."""
|
|
600
|
+
from abkit.core.interval import Interval
|
|
601
|
+
|
|
602
|
+
try:
|
|
603
|
+
seconds = Interval(raw).seconds
|
|
604
|
+
except Exception as exc:
|
|
605
|
+
raise click.BadParameter(
|
|
606
|
+
f"--from-history '{raw}' is not an interval (e.g. 14d, 2w)",
|
|
607
|
+
param_hint="--from-history",
|
|
608
|
+
) from exc
|
|
609
|
+
if seconds <= 0 or seconds % 86400 != 0:
|
|
610
|
+
raise click.BadParameter(
|
|
611
|
+
f"--from-history '{raw}' must be a positive WHOLE number of days "
|
|
612
|
+
"(the pre-period window is day-aligned in the experiment timezone)",
|
|
613
|
+
param_hint="--from-history",
|
|
614
|
+
)
|
|
615
|
+
|
|
616
|
+
|
|
456
617
|
def _resolve_moments(
|
|
457
|
-
experiment,
|
|
618
|
+
experiment,
|
|
619
|
+
comparison,
|
|
620
|
+
kind: str,
|
|
621
|
+
override,
|
|
622
|
+
tables,
|
|
623
|
+
notes: list[str],
|
|
624
|
+
history: _HistoryBaselines | None = None,
|
|
458
625
|
) -> BaselineMoments | None:
|
|
459
626
|
if override is not None:
|
|
460
627
|
try:
|
|
461
|
-
|
|
628
|
+
moments = moments_from_override(kind, override)
|
|
462
629
|
except ValueError as exc:
|
|
463
630
|
raise click.BadParameter(str(exc), param_hint="--baseline") from exc
|
|
631
|
+
if (
|
|
632
|
+
moments.corr_coef is not None
|
|
633
|
+
and not get_method_class(comparison.method.name).requires_covariate
|
|
634
|
+
):
|
|
635
|
+
# Deflating a method that will not run CUPED promises a variance reduction
|
|
636
|
+
# the analysis cannot deliver — refuse where it was typed rather than print
|
|
637
|
+
# an under-stated required-N.
|
|
638
|
+
raise click.BadParameter(
|
|
639
|
+
f"--baseline {comparison.metric}: 'corr' sizes a covariate method, but "
|
|
640
|
+
f"{comparison.metric} is planned with '{comparison.method.name}' — drop "
|
|
641
|
+
"'corr' or plan a cuped-t-test comparison",
|
|
642
|
+
param_hint="--baseline",
|
|
643
|
+
)
|
|
644
|
+
return moments
|
|
645
|
+
# Precedence (contract step 3): an explicit --baseline wins, then --from-history,
|
|
646
|
+
# then the persisted rows. A hand-typed number is the operator's deliberate
|
|
647
|
+
# statement; a history render is a measurement of the wrong population; a
|
|
648
|
+
# persisted row is this experiment's own cohort and the most specific of all —
|
|
649
|
+
# but it only exists once the experiment has run, which is the case
|
|
650
|
+
# --from-history is for. Whichever wins names itself in the plan line.
|
|
651
|
+
if history is not None:
|
|
652
|
+
from_history = history.moments(comparison, kind)
|
|
653
|
+
if from_history is not None:
|
|
654
|
+
notes.extend(_history_notes(experiment, history))
|
|
655
|
+
return from_history
|
|
656
|
+
if comparison.metric in history.failures:
|
|
657
|
+
return None # the SKIPPED line names the render failure
|
|
464
658
|
if tables is None:
|
|
465
659
|
return None
|
|
466
660
|
return _moments_from_results(experiment, comparison, kind, tables)
|
|
467
661
|
|
|
468
662
|
|
|
663
|
+
def _covariate_note(moments: BaselineMoments) -> str:
|
|
664
|
+
"""The one line a CUPED plan states about the variance it was sized on (PLAN-1).
|
|
665
|
+
|
|
666
|
+
Every branch names what it used, because "required-N" without its variance basis
|
|
667
|
+
is the number an operator would then plan a launch around. The pre-PLAN-1 note
|
|
668
|
+
said the correlation "is not persisted", which M9 WP1 made false for every row
|
|
669
|
+
written since ``0.4.0``.
|
|
670
|
+
"""
|
|
671
|
+
rho = moments.usable_corr
|
|
672
|
+
if rho is None:
|
|
673
|
+
if moments.corr_coef is None:
|
|
674
|
+
# Two different causes, two different fixes: a hand-typed baseline simply
|
|
675
|
+
# omitted `corr=`, while a persisted one predates the 0.4.0 column. Naming
|
|
676
|
+
# the wrong one sends the operator to re-run an experiment that would not
|
|
677
|
+
# have helped (or to look for a flag that would not have applied).
|
|
678
|
+
if moments.source.startswith("--baseline"):
|
|
679
|
+
return (
|
|
680
|
+
"sized on RAW variance — the --baseline override carries no 'corr', "
|
|
681
|
+
"so required-N is an upper bound (add corr=<ρ> to size on CUPED)"
|
|
682
|
+
)
|
|
683
|
+
return (
|
|
684
|
+
"sized on RAW variance — no covariate correlation on the baseline row "
|
|
685
|
+
"(rows written before 0.4.0 carry none), so required-N is an upper bound"
|
|
686
|
+
)
|
|
687
|
+
return (
|
|
688
|
+
f"sized on RAW variance — ρ = {moments.corr_coef:.6g} leaves no usable "
|
|
689
|
+
"residual variance (the covariate reproduces the metric), so a deflated "
|
|
690
|
+
"required-N would be rounding noise"
|
|
691
|
+
)
|
|
692
|
+
if rho == 0.0:
|
|
693
|
+
return (
|
|
694
|
+
"sized on RAW variance — the baseline's covariate correlation is ρ = 0, "
|
|
695
|
+
"so CUPED reduces no variance here (this is a measurement, not a missing value)"
|
|
696
|
+
)
|
|
697
|
+
share = 1.0 - rho * rho
|
|
698
|
+
note = (
|
|
699
|
+
f"sized on CUPED-deflated variance (ρ = {rho:.4g}) — required-N is "
|
|
700
|
+
f"{share:.3g}× the raw-variance bound"
|
|
701
|
+
)
|
|
702
|
+
if share < SUSPICIOUS_RESIDUAL_VARIANCE_SHARE:
|
|
703
|
+
# Computable, so we compute it — but a >100× reduction is far more often a
|
|
704
|
+
# covariate derived from the metric than a real one, and this is the number
|
|
705
|
+
# someone sizes a launch on. Say so on the line, do not silently under-size.
|
|
706
|
+
note += (
|
|
707
|
+
f" — that is a {1.0 / share:,.0f}× reduction; check that the covariate is "
|
|
708
|
+
"not derived from the metric"
|
|
709
|
+
)
|
|
710
|
+
return note
|
|
711
|
+
|
|
712
|
+
|
|
469
713
|
def _moments_from_results(experiment, comparison, kind: str, tables) -> BaselineMoments | None:
|
|
470
714
|
"""Latest usable persisted control/treatment moments for the first-pair series."""
|
|
471
715
|
variants = experiment.assignment.variants
|
|
@@ -508,7 +752,12 @@ def _moments_from_results(experiment, comparison, kind: str, tables) -> Baseline
|
|
|
508
752
|
std_1 = _num(latest.get("std_1"))
|
|
509
753
|
if std_1 is None or std_1 <= 0:
|
|
510
754
|
return None
|
|
511
|
-
|
|
755
|
+
# M9 WP1 persists the control arm's value↔covariate correlation beside its std, and
|
|
756
|
+
# the rows are already filtered to THIS comparison's method_config_id — so a non-NULL
|
|
757
|
+
# corr_coef_1 is this method's own CUPED correlation, never another method's.
|
|
758
|
+
# `_num` maps NULL/NaN/inf to None; `usable_corr` makes the final call.
|
|
759
|
+
corr_1 = _num(latest.get("corr_coef_1"))
|
|
760
|
+
return BaselineMoments(SAMPLE, value_1, float(size_1), float(size_2), std_1, source, corr_1)
|
|
512
761
|
|
|
513
762
|
|
|
514
763
|
def _num(value) -> float | None:
|