feat(customer-analytics): synthetic causal telco data model - #1
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
git diff-able) and CI validates it withuvx pytestwithout installing anything.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 indata-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)
Notes
data/is git-ignored — reproduce from the seed (byte-for-byte).usage_dailyin 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, notCloses— this is the foundation; the five cases are the rest of #64.🤖 Generated with Claude Code