Where this session sits
Everything converges here. a2's cohort triangle is the report's data spine, a3's gallery decides which chart goes upstairs, a4's segments explain who moved, a5's survival curves and a6's P(alive) price the lifetimes, and a7's risk scores name who to act on. Today they become ONE deliverable: the stakeholder one-pager plus its analyst appendix, built end to end on the real Online Retail II dataset in the companion notebook notebooks/a8_capstone.ipynb. This is the deliverable a1 defined - and the one you ship at work next week.
The spec: what a retention report must answer 10 min live
A retention report is not a chart dump. It is a one-page answer to three questions, backed by an appendix, bound by one contract. Write the spec before touching pandas - the spec is what stops the notebook from becoming forty cells of exploration with no verdict.
LiveThe three questions, the frozen contract, the one-chart rule8 min▶
A retention report answers exactly three questions, in this order:
- WHICH cohort? Named precisely: "customers whose first purchase was Feb-May 2011", not "recent customers". The denominator definition (all signups vs activated; purchase-based for ecommerce) is written on the page.
- WHAT changed, vs what? A number is meaningless without its comparison cohort: "month-3 retention 31% vs 27% for the Dec-Jan cohorts". Cohort ages compared, never calendar periods.
- HOW MUCH money? Delta retention x cohort size x ARPU. Four points of month-3 retention on 4,000 customers at $30 monthly gross profit is a real number executives can rank against other projects.
And two standing rules bind the whole document:
- The frozen-history contract: completed months are immutable - this quarter's report must show the SAME numbers for them as last quarter's report, provably. Only the current partial month updates, and it is visibly marked partial. A report whose history restates cannot be trusted, compared, or targeted against. In Part 2 this contract becomes an assert.
- The one-chart rule: executives get ONE chart - the D30-by-cohort trend line ("are we improving?") or the layer-cake ("is revenue durable?"). The raw triangle, the KM curves, the SHAP beeswarm: appendix. Upstairs answers a question; the appendix proves you did the work.
Here is the upstairs chart itself: month-1 retention by join cohort, one line, with the two launches that moved it flagged on the axis.
Build it end to end ★ 25 min · everyone builds
Six steps from raw invoices to a shippable report. Steps 1-2 are a2's recipe verbatim - if any step feels new, that session is the reference. The new muscle today is steps 5 and 6: translating a finding into money, and writing the frozen-history contract as code that fails loudly.
Clean-up gate. Drop C-prefix invoices (cancellations with negative Quantity), rows missing CustomerID (~135k guest checkouts - despite the metadata claiming none missing), and any remaining negative quantities. Annotate the left-censored first cohort: December 2009 sweeps in pre-existing customers as if new.
Cohort table + masked heatmap. a2's recipe verbatim: stamp, age, count, divide - then the four heatmap choices: annot, mask the future, anchor vmin/vmax, single-hue safe cmap.
Pick the finding. Read down the columns for cohort-over-cohort improvement or deterioration; check the diagonals for calendar shocks (a December spike is seasonality, not genius). One finding. The report is a verdict, not a tour.
Segment the finding. a4's split: is the improvement everyone, or one RFM tier, one channel, one behavior? Wholesalers out first - a handful of weekly trade buyers will dominate any average.
Translate to money. Delta retention x cohort size x ARPU, with ARPU from a6's cumulative cohort gross profit, not a hopeful LTV formula. This line is why the meeting happens.
Snapshot. Write the frozen numbers to a dated CSV and assert that every completed cell matches the prior quarter's snapshot. History restating is now a crash, not a surprise.
Live★ Build-along: the three code moments (steps 2, 5, 6)12 min▶
The snapshot is half the contract. The other half - the assert that reads it back next quarter - gets its own card below, because it is the single most transferable pattern on this page.
LiveThe snapshot-assert: the frozen-history contract as code6 min▶
Frozen history is the law (a2); today it becomes machinery. Before this quarter's report renders, re-read the PRIOR quarter's snapshot and assert that every cell whose window had already completed then is bit-identical now. If the assert fires, something upstream changed - a silent filter edit, a timezone shift, a redefined denominator - and the report must not ship until you know why.
Notice what this buys you politically, not just technically: when a stakeholder asks "why is January's number different from last quarter's deck?", your answer is "it cannot be - the build fails if it is". That sentence is worth more than any model behind the report.
The ship-or-not scorecard 10 min live
A report that fails one row fails. There is no seven-out-of-eight: a missing denominator definition or a restated January quietly poisons every other number on the page. Run the scorecard before every send - on your own report today, and on every retention readout anyone hands you from now on.
LiveEight rows, pass or do-not-ship6 min▶
- Which-cohort named - the cohort under discussion is identified by anchor date and definition, not "recent users".
- Comparison cohort named - the delta has an explicit baseline cohort, compared at the same age.
- Money line present - delta x size x ARPU appears on the page, in currency.
- Denominator definition written - all signups vs activated; purchase-based for ecommerce; stated, not assumed.
- History matches prior snapshot - the assert ran and passed; completed cells identical to last quarter's report.
- Immature cells masked and marked - the current partial month is visibly partial; NaN never rendered as low retention.
- Benchmark carries year + source - "GameAnalytics 2025 median D7 ~3.4-3.9%", never a naked "industry says".
- One chart upstairs, triangle in appendix - the exec page has exactly one chart; the triangle and diagnostics live behind it.
Frame it exactly this way with your team: ship or do-not-ship. Partial credit is how restated dashboards and unmarked partial months get normalized.
Self-studyPresenting it: the verdict sentence and the two hard questions5 min read▶
Lead with the verdict sentence. Not the methodology, not the caveats: "February-May cohorts retain 4 points better at month 3; worth roughly $X by year end if it holds." Everything else on the page exists to survive the questions that sentence provokes.
- Anticipate the mix-shift question (s4's trap). "Did retention improve, or did we just acquire stickier customers?" Blended retention can rise while every segment falls if acquisition shifts toward a stickier channel. Your step-4 segment split is the answer - have the by-segment view in the appendix before anyone asks.
- Keep the answer to WHY honest. Cohort data shows WHEN and WHERE retention changed - it cannot prove why. The behavioral splits and a7's SHAP drivers are hypotheses, and hypotheses get tested with experiments: that handoff belongs to learn-experimentation-with-phoebe, and saying so out loud is what separates a report from a story.
This deliverable is the Duolingo discipline in miniature. Jorge Mazal's team (in Lenny's Newsletter) ranked candidate metrics by sensitivity analysis, found CURR - current-user retention rate - had roughly 5x the DAU impact of the next metric, made it the north star, and drove decisions from cohort movements against it: CURR +21% and ~4.5x DAU over about four years. One metric chosen deliberately, one chart watched, decisions traced to cohort movements - exactly the shape of the one-pager you just built, at a few thousand times the headcount.
Ship it for real - this month ◐ the real capstone
- Build the full report on YOUR product's data: clean-up gate, cohort table, one finding, segment split, money line, dated snapshot with the re-read assert.
- Present it to one real stakeholder - a PM, a founder, your manager. Lead with the verdict sentence and stop talking.
- Record which of the 8 scorecard rows they pushed on. (It is almost always the denominator or the money line - the two rows analysts most often skip.)
- Next quarter, re-run the report and let the snapshot-assert do its job. The first time it catches a silent upstream change, the work has paid for itself.
What this session draws on
The capstone invents nothing new - it enforces every discipline from a1-a7 on real data, under a ship gate:
Three questions before you go 🎯 ◐ 90 seconds
1 · Which chart goes on the executive page, and where does the cohort triangle live?
The triangle is analyst food: it answers twenty questions at once, which is exactly why it answers none for an executive. Upstairs gets the single chart matched to the question at hand ("are we improving?" = trend line; "is revenue durable?" = layer-cake), with the so-what annotated on the chart itself. The triangle proves the work - in the appendix.
2 · What does the snapshot-assert in step 6 actually protect against?
Completed windows are immutable by the frozen-history law, so if a completed cell differs from the prior snapshot, something upstream changed - a filter, a timezone, a denominator - and every trend in the report is suspect. The assert turns that silent poison into a loud build failure, and turns "why did January change?" into "it cannot - the build fails if it does".
3 · Your report shows Feb-May cohorts retaining 4 points better after the new onboarding launched. What can the cohort data claim?
Cohort tables are observational: they localize the change precisely in time and segment, which is enormously useful - but the acquisition mix, seasonality, or pricing may have moved too. Behavioral splits and a7's SHAP drivers generate the WHY hypotheses; testing them is experiment design, handed off to learn-experimentation-with-phoebe.