Skip to content

feat(customer-analytics): synthetic causal telco data model - #1

Merged
ronaldmego merged 1 commit into
mainfrom
feat/customer-analytics-data-model
Jul 24, 2026
Merged

feat(customer-analytics): synthetic causal telco data model#1
ronaldmego merged 1 commit into
mainfrom
feat/customer-analytics-data-model

Conversation

@ronaldmego

Copy link
Copy Markdown
Owner

What

The foundation of the customer-analytics/ track (issue: ronaldmego/site-ronaldmego#64): one synthetic, causal, reproducible telco data model that all five cases — segmentation, churn, next-best-offer, ARPU, incrementality — will read from. No case notebooks yet; this is the shared dataset they stand on.

Why it's built this way

  • Standard library only. The generator has zero third-party deps, so it stays auditable (plain CSV, git diff-able) and CI validates it with uvx pytest without installing anything.
  • Explicit causal structure, so the cases are real and not circular:
    • churn is caused by observable trajectories (usage decline, payment problems, unresolved escalations, weak engagement, early life, plan misfit) plus unobserved satisfaction + noise → a model recovers signal but never fits perfectly;
    • retention campaigns carry a true uplift but are targeted at high-risk customers (selection bias) with a held-out control → incrementality is non-trivial to estimate correctly.
  • No leakage by construction. Every fact stops at the observation cutoff; the churn outcome lives in the next 90 days. There is nothing post-outcome to leak. A test enforces it.

Tables

12 related tables — reference dims (plans, offers, campaigns), entity (customers, subscriptions), monthly facts (usage_monthly, billing, digital_monthly), events (support_interactions, campaign_exposures), policy (consent) and the target (churn_labels). Full schema, grains and keys in data-model/README.md.

Tests (the repo's first suite)

tracks/customer-analytics/telco-customer-intelligence/tests/ — stdlib only, so CI runs them. They assert schema + referential integrity, the no-leakage property, that causal signal is actually present (churn rises with unresolved escalations; a control group exists), and determinism. Locally: 10 passed, ruff check . clean.

Reference signals (default run, seed 42 — re-derive, don't quote)

  • 90-day churn base rate ≈ 13% (realistic for telco)
  • churn with an unresolved escalation ≈ 28% vs ≈ 10% without
  • retention responders ≈ 20% vs held-out control ≈ 31% (both above base → the confounding the incrementality case must untangle)

Notes

  • Generated data/ is git-ignored — reproduce from the seed (byte-for-byte).
  • usage_daily in the issue body is intentionally modelled at monthly grain (documented) — churn/ARPU/RFM are monthly; daily would bloat CSVs ~30× with no analytical gain.
  • Refs, not Closes — this is the foundation; the five cases are the rest of #64.
  • Distribution (LinkedIn/video) is downstream and out of scope here — that's Hermes (ronaldmego/site-ronaldmego#65). This PR produces the reproducible artifact + write-up only.

🤖 Generated with Claude Code

Adds the foundation for the customer-analytics track: one synthetic,
causal, reproducible telco dataset that the five cases (segmentation,
churn, next-best-offer, ARPU, incrementality) will all read from.

- Seeded, standard-library-only generator (~12 related tables) — stays
  auditable and lets CI validate it without installing dependencies.
- Explicit causal structure: churn is caused by observable trajectories
  (usage decline, payment problems, unresolved support, weak engagement)
  plus unobserved satisfaction + noise, so a model recovers signal but
  never fits perfectly and never leaks. Retention campaigns carry a true
  but confounded uplift (targeted at high-risk) with a held-out control,
  so incrementality is non-trivial.
- No leakage by construction: every fact stops at the observation cutoff;
  the churn outcome lives in the next 90 days. Enforced by tests.
- Contract tests (stdlib, so CI's uvx pytest runs them): schema,
  referential integrity, no-leakage, causal signal, determinism.
- Data card documents the synthetic nature; generated data/ is gitignored
  (reproduce from the seed, byte-for-byte).
- README/track labels updated; the customer-analytics track is no longer
  empty and now carries the repo's first test suite.

Refs ronaldmego/site-ronaldmego#64

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018sqb1B8U1WP7H6hV1tb6Uq
@ronaldmego
ronaldmego merged commit 43b978f into main Jul 24, 2026
3 checks passed
@ronaldmego
ronaldmego deleted the feat/customer-analytics-data-model branch July 24, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant