跳到正文
Skillpedia
分析与电子表格41k · #6876

configuring-experiment-rollout

它能做什么

本技能设置变体的分配比例,例如 50/50,以及进入实验的用户比例。适合希望安全、公平地设置测试流量的人。

适用场景

  • ✓当你想选择对照组与测试组之间的分配比例时。
  • ✓当有人提出上线比例,而你需要了解其含义的时候。
  • ✓当你考虑 80/20 之类的不均等分配,并希望避免偏差的时候。

技能链接

https://github.com/PostHog/posthog/blob/master/products/experiments/skills/configuring-experiment-rollout/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/PostHog/posthog/blob/master/products/experiments/skills/configuring-experiment-rollout/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请用 50/50 的比例设置我的实验,并将其上线给 25% 的用户。”

每周 5 个新技能,1 分钟读完。

工作原理

默认推荐均等分配,并通过调整总体上线比例,控制有多少流量被曝光。它还会提醒不均等分配可能带来的偏差。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Configuring experiment rollout

This skill answers: Who sees what variant?

Recommended approach: equal split + adjust rollout percentage

In most cases, experiments work best with an equal split. If you want to limit exposure to the test variant, adjust the rollout percentage instead.

Why equal splits are better:

  • Equal splits maximize statistical power — each variant has the same sample size
  • Equal splits balance traffic and thus reach significance faster
  • Increasing user exposure throughout the experiment through increasing rollout is clean (changing split mid-experiment can cause users to switch variants, which is bad for user experience and data quality)

Always default to an equal split unless the user explicitly requests otherwise.

When an uneven split is required

Uneven splits combined with the default "Exclude from analysis" handling can introduce bias. If the experiment observes multi-variant users (users exposed to more than one variant) then those are dropped asymmetrically — the smaller variant loses a larger fraction of its assignments. If those users behave differently from the rest, the smaller variant's metrics will be skewed.

The right mitigation depends on experiment state:

  1. Pre-launch, or live but with few exposures so far — use an equal split and reduce the overall rollout. Achieves the same test-variant exposure without the bias and preserves statistical power. See the disambiguation question below.
  2. Live experiment with significant exposures — switch multivariate handling to "First seen variant". Changing the split mid-run reassigns users across variants (anti-pattern; see "Changing rollout on a running experiment" below). Switching handling instead keeps everyone in their original variant and avoids the asymmetric exclusion. See configuring-experiment-analytics for how to set this. Note that "first seen" handling can introduce other biases, but it's preferable to mid-run reassignment.

The two rollout controls

There are two separate controls that determine who sees what. Both live on the linked feature flag, sent through the feature_flag object in the flag's own shape (not the deprecated parameters keys).

1. Variant split (feature_flag.filters.multivariate.variants)

How users inside the experiment are distributed across variants.

  • Array of {key, name, rollout_percentage}, where the rollout_percentage values must sum to 100
  • Minimum 2 variants, maximum 20
  • No specific variant key is required — the analysis baseline defaults to the variant keyed "control" when present, else the first variant
  • Default: control 50% / test 50%

If the user says "A/B/C test" without naming keys, key the baseline "control" (the convention) and create additional variants for the others; if they ask for specific keys, use them as-is with the baseline first.

2. Overall rollout (feature_flag.filters.groups[0].rollout_percentage)

What percentage of all users enter the experiment at all, sent as a single rollout group: groups: [{ "properties": [], "rollout_percentage": N }]. Default: 100%.

Users not included are excluded entirely: they don't see any variant and are not part of the analysis.

Where these are sent

Both controls live inside feature_flag.filters:

{
  "feature_flag": {
    "filters": {
      "multivariate": {
        "variants": [
          { "key": "control", "name": "Control", "rollout_percentage": 50 },
          { "key": "test", "name": "Test", "rollout_percentage": 50 }
        ]
      },
      "groups": [{ "properties": [], "rollout_percentage": 100 }]
    }
  }
}

filters may also carry aggregation_group_type_index (to run the experiment on a group type rather than individual users) and payloads (JSON-encoded strings keyed by variant key). On a running experiment, any flag-config change must also send update_feature_flag_params: true, otherwise the API rejects the update before it reaches the flag (see "Changing rollout on a running experiment").

How they interact

These two controls multiply:

Overall rollout Variant split % seeing test % in analysis
100% 50/50 50% 100%
100% 75/25 control/test 25% 100%
50% 50/50 25% 50%
25%
常见问题

为什么使用均等分配?

均等分配会让每个变体拥有相同的样本量,有助于测试更快达到统计显著。

测试过程中可以更改分配比例吗?

最好不要。用户可能会切换变体,这会影响他们的体验,也会降低数据质量。

为什么不均等分配有风险?

看到多个变体的用户会被不均匀地剔除,这可能会扭曲较小变体的结果。

详情

作者的原始描述

Configures the rollout shape of a PostHog experiment — the variant split (50/50, 80/20, A/B/C ratios), the overall rollout percentage that gates how many users enter the experiment, and the disambiguation when a percentage like "roll out to 25%" could mean either. Use when the user mentions a rollout percentage, variant split, or traffic distribution; gives a ratio like 60/40, 70/30, or 80/20; asks "who sees the test variant?"; wants to increase, decrease, or change the rollout or split on a draft or running experiment; weighs equal vs uneven splits; or proposes a mid-experiment split change (

repo: PostHog/posthog

热度

GitHub 星标
41k
排名
#6876
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能