01 / Dataframe or warehouse
Same analysis. Two ways in.
From a dataframe
One row per unit is all it takes: no YAML, no warehouse connection, not even DuckDB.
import increment
experiment, reader = increment.from_frame(
df,
shape="summary",
unit="user_id",
group="variant",
control="control",
metrics=["revenue", "converted"],
)
results = increment.run(experiment, reader)>>> df.head(3)
user_id variant revenue converted
0 u1 control 0.00 False
1 u2 treatment 42.50 True
2 u3 control 18.00 TrueFrom your warehouse
Declare experiments and metrics once in version-controlled YAML. Install increment[warehouse] and your Ibis backend to run the generated SQL in your warehouse.
experiments:
- name: checkout_redesign
exposure: checkout_view
unit: user_id
control_group: control
start: 2026-09-01
plan:
primary: converted
secondaries: [revenue]metrics:
- name: converted
type: conversion
fact: order
entity: user_id
window_days: 14
- name: revenue
type: mean
fact: order
aggregation: sum
entity: user_id
window_days: 14import increment
# con is an Ibis connection to your warehouse
experiment, reader = increment.from_definitions(
"definitions/",
con,
experiment_name="checkout_redesign",
)
with reader:
results = increment.run(experiment, reader)