Sub topic 9
Segmenting Cohorts to Find Who the Product Fits
This chapter assumes you can build a cohort retention table (cohort month, age, distinct active users divided by cohort size) and read a retention curve. The code uses pandas. If you only want the ideas, you can skip the code and follow the tables and text.
Why a blended curve can mislead
A retention curve for all users is an average. If one group of users stays and another leaves almost at once, the average hides both groups. The curve may look like slow decay, when the truth is that the product fits one kind of user and does not fit another.
Segmenting means splitting each cohort into groups and computing a retention curve for each group. You are looking for a segment whose curve flattens (a plateau) even while the blended curve keeps falling. A flat curve in one segment is evidence of fit for that segment. Product-market fit is rarely "everyone" at first. It usually starts as "this specific kind of user."
The question is "for whom does this work?", which differs from "is retention good?". The answer tells you whom to market to, what to build next, and which users to stop acquiring.
Choosing segmentation dimensions
Pick dimensions that you can act on and that exist at the time the user signs up or in their first session. Dimensions known only later can mislead, as described under the pitfalls below.
| Dimension | Example values | What it can reveal |
|---|---|---|
| Acquisition channel | organic search, paid ads, referral, partner | Which channels bring users who stay |
| Company or user type | solo, small team, enterprise; student, professional | The customer profile the product fits |
| Plan or pricing tier | free, trial, paid | Whether willingness to pay lines up with retention |
| Geography or language | region, locale | Localization gaps or market-specific fit |
| Device or platform | web, iOS, Android | Platform quality problems |
| Use case or stated goal | answer given at onboarding | The job the product is actually hired for |
| First-session behavior | completed setup, invited a teammate | The early actions that predict staying |
The last row is a behavioral segment. These are powerful, but they need care, because the behavior happens after the user starts.
Computing retention by segment
The code below adds a segment column to the events and repeats the cohort calculation within each segment. It uses one cohort (January 2026) with two user types, so you can see the mechanics. The numbers are far too small to draw real conclusions from, which the next section addresses.
import pandas as pd
users = pd.DataFrame({
"user_id": range(1, 13),
"segment": ["team"] * 6 + ["solo"] * 6,
})
rows = [
(1, "2026-01-05"), (1, "2026-02-10"), (1, "2026-03-03"), (1, "2026-04-02"),
(2, "2026-01-08"), (2, "2026-02-12"), (2, "2026-03-09"),
(3, "2026-01-20"), (3, "2026-02-03"), (3, "2026-03-15"), (3, "2026-04-10"),
(4, "2026-01-22"), (4, "2026-02-25"),
(5, "2026-01-27"),
(6, "2026-01-30"), (6, "2026-02-28"), (6, "2026-03-28"),
(7, "2026-01-04"), (7, "2026-02-06"),
(8, "2026-01-09"),
(9, "2026-01-15"),
(10, "2026-01-18"),
(11, "2026-01-25"), (11, "2026-02-20"),
(12, "2026-01-29"),
]
events = pd.DataFrame(rows, columns=["user_id", "ts"])
events["ts"] = pd.to_datetime(events["ts"])
events["month"] = events["ts"].dt.to_period("M")
first = events.groupby("user_id")["month"].min().rename("cohort")
events = events.join(first, on="user_id").merge(users, on="user_id")
events["age"] = (
(events["month"].dt.year - events["cohort"].dt.year) * 12
+ (events["month"].dt.month - events["cohort"].dt.month)
)
active = (
events.groupby(["segment", "age"])["user_id"]
.nunique()
.unstack(fill_value=0)
)
retention = active.div(active[0], axis=0)
print(retention.round(2).assign(size=active[0]))
overall = events.groupby("age")["user_id"].nunique() / events["user_id"].nunique()
print(overall.round(2))The team segment retains 100%, 83%, 67%, and 33% over ages 0 to 3. The solo segment retains 100%, 33%, 0%, and 0%. The blended figure at age 1 is 58% (7 of 12 users). That number describes neither group. Averaging made the product look mediocre for everyone, when the pattern is that it works for teams and not for solo users.
Notice that the cohort is assigned before the segment split. Each user keeps their original cohort month, and the segment only divides the cohort. If you recomputed the cohort inside each segment from that segment's own first event, the data would still work here, but a user who changes segment later would break the logic. Assign the segment once, per user.
Small segments and noise
Splitting a cohort shrinks every group. A segment of six users moving from 5 retained to 3 retained changes its rate by 33 points. Before reading a segment curve, check its size and put an interval around the rate. The Wilson interval behaves better than the plain normal approximation when counts are small.
import math
def wilson(k, n, z=1.96):
p = k / n
denom = 1 + z**2 / n
centre = (p + z**2 / (2 * n)) / denom
half = z * math.sqrt(p * (1 - p) / n + z**2 / (4 * n**2)) / denom
return centre - half, centre + half
for seg in active.index:
n = active.loc[seg, 0]
k = active.loc[seg, 1]
lo, hi = wilson(k, n)
print(f"{seg}: {k}/{n} retained at age 1, 95% interval {lo:.2f} to {hi:.2f}")For team the interval runs from about 0.44 to 0.97. For solo it runs from about 0.10 to 0.70. The ranges overlap between 0.44 and 0.70, so with six users per group you cannot yet say the two segments really differ at age 1. The gap at ages 2 and 3 is suggestive, but you would want many more users before acting on it.
A practical rule: if a segment has fewer than roughly 100 users in a cohort, treat its curve as a hint and combine several cohorts, or merge it with a similar segment. Pooling cohorts is valid when you align on age rather than calendar month, which your cohort table already does.
Common mistakes when segmenting
- Segmenting on something that happens after signup. Suppose you split users into "invited a teammate" and "did not invite a teammate." The first group will retain better, but staying longer also gives people more time to invite someone. This is survivorship bias. If you use a behavioral segment, restrict it to a fixed early window, for example "invited a teammate within 7 days of signup," and apply the same window to every user.
- Cherry-picking among many cuts. If you try 20 dimensions with 5 values each, some segment will look good by chance. Write down your hypotheses before you slice. Confirm any promising segment on a later cohort that was not used to find it.
- Ignoring segment mix shifts. Overall retention can rise only because more users came from a high-retention channel, not because the product improved. When comparing cohorts over time, compare the same segment across cohorts as well as the blended number.
- Reading incomplete periods. A recent cohort has fewer observed ages, and a segment of it has the same limit. Blank out unobserved cells instead of showing them as zero.
- Treating segments as exclusive when they overlap. A user can be both "enterprise" and "from referral." Choose one dimension per table, or build the combined segment deliberately, and keep sizes in view.
Turning a segment into a fit judgment
A segment is a candidate for product-market fit when it meets most of these conditions:
- Its curve flattens at a nonzero level and stays flat over several periods.
- It has enough users that the interval around the plateau is narrow.
- The pattern repeats in more than one cohort.
- The segment can be reached again. You can name where those users come from and how to acquire more of them at an acceptable cost.
- The users did not get there through a one-time promotion or unusual event.
If a segment meets these, the product probably fits a narrow market, and the next step is to focus. That means tuning onboarding for that user, pointing acquisition at the channels that supply them, and holding back features aimed at users whose curves keep decaying. If no segment plateaus, segmentation has not found fit. It has told you that the problem is not hidden in the average.
Summary of the working model
- Segment each cohort by a dimension known at signup, and assign the segment once per user.
- Compute retention by age within each segment, and keep the size of each group next to its rates.
- Put an interval on small groups before comparing them.
- Look for a segment whose curve plateaus while the blended curve decays.
- Confirm on later cohorts, then treat the segment as the likely place where the product fits.
Exercise
A product's blended age-3 retention is 18%. When you segment by acquisition channel, referral users show 40% at age 3 on 250 users per cohort, and paid-ad users show 6% on 900 users per cohort. Paid ads are growing as a share of new signups each month. Name two things you would do before concluding that the product fits referral users, and say what the growing paid share means for the blended number over time.
Show answer
First, check that the referral curve actually flattens over several ages and that the pattern repeats across multiple cohorts, not just one, ideally including a cohort that was not used to find the pattern. Also compute an interval for the 40% figure given the 250-user size. Second, check that the referral advantage is not caused by something else, such as a one-time promotion, or by a mixed user type inside the referral group. The growing paid share will pull the blended retention number down even if neither segment's own curve changes. This is a mix shift, so a falling blended number would not by itself mean the product got worse.