Project 03 · Data Engineering

Churn Prediction on Databricks:Governed ML with Unity Catalog

An end-to-end ML architecture on Databricks, governed by Unity Catalog throughout. Features are declared as Feature Views with point-in-time correctness; experiments and models are tracked in MLflow 3 and registered to the UC three-level namespace; deployment is Champion/Challenger via aliases. Lakehouse Monitoring profiles inference tables for drift and triggers retraining, and everything ships through Databricks Asset Bundles in Azure DevOps.

Deployment pattern
Champion / ChallengerDeployment pattern
Feature join correctness
Point-in-timeFeature join correctness
Monitoring loop
Drift → retrainMonitoring loop
UC namespace
catalog.schema.modelUC namespace
  • Databricks
  • Unity Catalog
  • Delta Lake
  • MLflow 3
  • Feature Store
  • Model Serving
  • Lakehouse Monitoring
  • Asset Bundles
  • Azure DevOps

Select any component to see how it works.

Data Foundation

Delta Lake on Unity Catalog

Upstream: Gold-layer Delta tables produced by the existing ADF ingestion pipelines.

Feature Engineering

Feature Views in Unity Catalog

Model Development

MLflow 3 tracking & evaluation

Governance & Registry

UC model registry & aliases

Serving & Action

Batch, real-time, write-back

Closing the loop: outcomes flow back as labels for the next training cycle.

Cross-cutting platform concerns

Reference architecture · Databricks · Select any block for detail

Read every component in full

Component reference

Every component in the architecture above, in detail — each with a plain-language summary and the technical implementation.

Data FoundationDelta Lake — Gold LayerCurated, governed Delta tables under Unity Catalog — the input to everything downstream.

In plain terms

This doesn't need any new data collection. It runs on what the business already has: purchase history, support contacts, how often someone logs in, how long they've been a customer.

Why that matters

  • No new systems, no new data capture, no privacy conversation about collecting something extra
  • The value comes from connecting data that already exists, not gathering more
  • Because it's all in one governed place, the model sees a complete picture rather than one department's slice

Technical detail

What sits here

  • Gold-layer Delta tables — conformed customer, transaction and interaction facts
  • Registered in Unity Catalog under a three-level namespace: catalog.schema.table
  • Produced by the upstream ingestion pipelines — this architecture consumes them, it doesn't rebuild them

Why Delta specifically

  • Time travel — training data can be reproduced exactly as it stood on the training date
  • ACID transactions — no partially-written table feeding a training run
  • Schema enforcement — an upstream change surfaces as an error, not as silently corrupted features
Reproducibility starts here. A model you cannot retrain on the exact data it originally saw is a model you cannot debug.
Data FoundationLabel Definition & WindowingThe single highest-leverage decision in the whole pipeline.

In plain terms

Before predicting churn, the business has to agree on what churn is. This sounds obvious. It is where most projects quietly go wrong.

The questions that must be answered

  • Is a customer "gone" when they cancel — or after 90 days of silence?
  • Does a downgrade count, or only a full exit?
  • How far ahead are we predicting — next month, next quarter?
  • Is there enough time to act on the warning? A prediction that arrives the day someone leaves is useless
Why this comes first: a model can be technically flawless and commercially worthless if it predicts the wrong thing, or predicts it too late to matter. This is a business conversation, not a modelling one.

Technical detail

What gets pinned down

  • Churn event — the precise, queryable definition (contract end, N days inactive, downgrade below threshold)
  • Observation window — how much history feeds each example
  • Prediction horizon — how far forward the label looks
  • Intervention lead time — the horizon must exceed the time the business needs to act

Traps this avoids

  • Label leakage — features computed after the churn event (a cancellation ticket, a final invoice) make training scores look excellent and production performance collapse
  • Class imbalance — churn is usually rare; accuracy is a misleading metric and PR-AUC is reported instead
  • Silent redefinition — the definition lives in version-controlled code, not in someone's head
The single most common cause of a churn model that "worked in testing" is a leaked label. Defining the window explicitly, up front, is what prevents it.
Feature EngineeringFeature Views in Unity CatalogFeatures declared as UC objects, with pipelines managed by Databricks.

In plain terms

Raw history doesn't predict anything on its own. "This customer placed an order in March" is a fact. "Their order frequency has halved over three months" is a warning sign.

The kind of signals used

  • Slowing down — orders, logins or usage declining versus their own past
  • Friction — more support tickets, slower resolution, repeat complaints
  • Disengagement — emails unopened, product features abandoned
  • Relationship shifts — their main contact leaves, or stops responding
Why they're defined centrally: "active customer" is calculated once, in one place, and reused by every model and report. Without that, two teams build two definitions and the numbers stop agreeing.

Technical detail

Why Feature Views

  • Features are declared as Unity Catalog objects — Databricks creates and manages the underlying pipelines
  • Supports time-windowed aggregations natively, which is most of what churn features are
  • Governed, discoverable and shareable across workspaces like any other UC asset
  • Models trained on them automatically capture lineage back to the features used

Feature Views vs Feature Tables

  • Feature Views — declarative, Databricks-managed pipelines; the recommended default
  • Feature Tables — a UC Delta table with a primary key that you write to and own; used where the computation is too bespoke to declare
The legacy workspace-scoped Feature Store is deprecated. Feature governance now lives in Unity Catalog alongside everything else.
Feature EngineeringPoint-in-Time CorrectnessThe mechanism that stops future information leaking into training.

In plain terms

Here's a trap that has quietly ruined a great many ML projects.

Say you're training on a customer who left in June. If the model is shown their support-ticket count as it stands today, it's seeing tickets they raised while cancelling — information that didn't exist back in June.

What happens next

  • The model looks brilliant in testing — it's effectively been shown the answer
  • In production it performs poorly, because that information isn't available yet for a customer who hasn't churned
  • Trust in the whole project collapses, usually before anyone works out why

How this design prevents it

  • Every feature is retrieved as it stood on the date being predicted — never as it stands now
  • The platform enforces this rather than relying on someone remembering
In one line: the model is only ever shown what would genuinely have been known at the moment of the prediction. It's the difference between a model that works in a demo and one that works in production.

Technical detail

The mechanism

  • Training sets are assembled with a point-in-time join: feature values as of the timestamp each label observation was recorded
  • This is native to the Feature Store rather than hand-rolled with window functions
  • It eliminates train/serve skew — the same lookup logic applies at training and at inference

Why hand-rolling this goes wrong

  • Correct temporal joins across many feature tables at differing grains are genuinely difficult to get right
  • Errors are silent — they produce optimistic offline metrics rather than exceptions
  • The gap only surfaces in production, by which point the model is already distrusted
Leakage doesn't announce itself. A suspiciously high offline AUC on a churn problem is a signal to audit the temporal join before celebrating.
Feature EngineeringOnline Feature StoreLow-latency feature lookup for real-time inference, from the same definitions.

In plain terms

Most of the time a nightly ranked list is exactly right. Occasionally someone needs an answer immediately — a rep has the customer on the phone right now.

How that's handled

  • The same signals are kept somewhere they can be looked up in milliseconds
  • The score is calculated on the spot, using the identical logic as the nightly run
  • Because both paths share one definition, the live answer and the overnight answer can't disagree
This is optional, and worth being honest about: it adds real cost and complexity. If nobody needs a score inside a business day, the batch path alone is the better engineering decision.

Technical detail

What it provides

  • Feature values published to the Online Feature Store for low-latency retrieval
  • Automatic feature lookup at inference — the serving endpoint fetches features by entity key
  • On-demand computation for features that must be derived from request-time input

Why it's the same definition

  • Offline training and online serving resolve from one feature definition, which is what keeps skew out
  • A separately reimplemented "real-time version" of a feature is a well-known source of silent divergence
Honest scoping: real-time serving is justified by a real latency requirement, not by novelty. Batch scoring covers most churn use cases at a fraction of the operational cost.
Model DevelopmentMLflow Experiment TrackingEvery run captured — parameters, metrics, artifacts and the data version behind them.

In plain terms

Building a model means trying many approaches. Without discipline, six weeks in, nobody can remember which version was best or how it was produced.

What's recorded automatically

  • Every attempt, with its settings and its scores
  • Which data it was trained on, and as of when
  • Who ran it and when

Why a client should care

  • Six months on, you can still answer "why does this model behave this way?"
  • If a regulator or auditor asks how a decision was reached, there's a trail
  • The work doesn't leave with whoever built it
This is the difference between a model the business owns and a model that lives in one person's notebook.

Technical detail

Captured per run

  • Hyperparameters, metrics and artifacts
  • Source notebook or bundle revision
  • Data version — the Delta table version used, making the run reproducible via time travel
  • Feature lineage, inherited automatically from Feature Store usage

MLflow 3 on Databricks

  • Models capture parameters and metrics directly, surfaced on the model version page
  • Runs and models are visible across workspaces, not siloed per workspace
  • The registry URI defaults to databricks-uc, so UC is the registry by default
Reproducibility here is concrete, not aspirational: run ID → code revision → Delta version → feature lineage.
Model DevelopmentAutoML BaselineA transparent, fast baseline that every later model must beat.

In plain terms

Before spending weeks hand-building a model, it's worth spending a day finding out whether the data can predict churn at all.

What this does

  • Automatically tries a range of standard approaches
  • Reports how well the best one performs
  • Produces the actual code it used — nothing is hidden in a black box

Why it's a genuinely good idea

  • If the automated attempt performs poorly, that's an early, cheap signal — usually meaning the data or the label definition needs work, not the algorithm
  • If it performs well, you have a working baseline in days rather than weeks
  • Every custom model afterwards has a clear bar to beat, so effort is justified by measured improvement
Finding out in week one that the approach won't work is a success, not a failure. It's far better than finding out in month three.

Technical detail

Role in the workflow

  • Establishes a defensible baseline metric before bespoke development begins
  • Glass-box — generates the underlying notebooks, so the baseline is inspectable and forkable rather than opaque
  • Handles the standard preprocessing and model search, surfacing the leaderboard in MLflow

Why the baseline discipline matters

  • Custom modelling effort has to be justified by measured lift over the baseline, not by assumption
  • A weak baseline is diagnostic — it usually indicates a feature or label problem, and points effort at the right layer
  • Generated notebooks are a legitimate starting point for the bespoke model rather than throwaway output
Model DevelopmentEvaluation & Model SignatureThe quality gate — metrics chosen for the problem, not for the headline.

In plain terms

Suppose 5% of customers churn each year. A model that simply predicts "nobody will ever leave" is 95% accurate — and completely worthless.

This is why accuracy is the wrong measure for this problem, and why quoting it would be misleading.

What's actually measured

  • Of the customers it flags, how many really do leave? — flag everyone and you waste the team's time
  • Of the customers who leave, how many did it catch? — miss most of them and there's no point
  • Are the risk scores meaningful? — "80% likely" should mean roughly 80% of those customers actually leave
  • Does it work fairly across the board? — a model strong on large accounts and weak on small ones is only half a model
Worth asking any vendor: when someone quotes a single accuracy number for a churn model, that number is almost certainly hiding the imbalance described above.

Technical detail

Metrics that fit the problem

  • PR-AUC as the headline — appropriate under class imbalance where ROC-AUC flatters
  • Precision@k — the operationally meaningful measure, since the team can only work a fixed-size list
  • Calibration — predicted probabilities must be trustworthy if they drive prioritisation or spend
  • Slice analysis — performance by segment, tenure and value band, to catch aggregate metrics hiding segment failure

Model signature

  • Unity Catalog requires a model signature on every registered version — input and output schema are explicit
  • This turns a schema mismatch into a clear error at deployment rather than corrupted scores in production
Threshold selection is a business decision, not a default: it trades investigation capacity against customers missed, and belongs in a conversation with whoever works the list.
Governance & RegistryUnity Catalog Model RegistryModels governed as first-class UC objects, in the same namespace as data.

In plain terms

Models are registered in one official place — the same governed system that controls the data itself. Not a file on a laptop, not a notebook someone bookmarked.

What that gives you

  • A definitive answer to "which model is actually running right now?"
  • Controlled permissions — who can create, who can approve, who can use
  • Full history, so you can always see what came before and go back to it
  • Traceability from a live prediction all the way back to the data it learned from
If a customer ever asks why they were flagged as at-risk, that question is answerable. Models governed as loose files can't answer it.

Technical detail

Three-level namespace

  • Models are addressed as catalog.schema.model — e.g. prod.ml_churn.churn_model
  • The catalog expresses the environment, which is how dev/staging/prod separation is represented
  • Models sit in the same governance plane as tables and features — one permission model, not two

Privileges

USE CATALOGUSE SCHEMACREATE MODEL CREATE MODEL VERSIONEXECUTE

What this replaces

  • The workspace-scoped model registry, which was siloed per workspace and separate from data governance
  • Lineage now spans data → features → model → predictions in a single graph
Governance & RegistryModel AliasesDeployment by mutable alias rather than by stage — the UC pattern.

In plain terms

There's always one model officially in charge — the Champion. When a new one is built, it doesn't simply take over.

How a new model earns the job

  • The new model becomes the Challenger and runs quietly alongside
  • Both make predictions on the same real customers
  • After enough time, the two are compared on what actually happened
  • Only if the Challenger genuinely does better does it become the new Champion
  • If the change goes badly, reverting is instant — the previous version is untouched
The business reason: a model that looked better in testing can still be worse in reality. This makes that discovery cheap and reversible instead of expensive and public.

Technical detail

Aliases, not stages

  • Unity Catalog does not support MLflow stages. Deployment is expressed through aliases — mutable named pointers to a specific version
  • Loading by alias: models:/prod.ml_churn.churn_model@Champion
  • Promotion is a pointer reassignment — no code change, no redeploy, instantly reversible

The pattern in practice

  • @Champion serves production traffic
  • @Challenger scores in parallel, writing to the same inference table with a model-version tag
  • Comparison happens on realised outcomes, not offline metrics — the only comparison that settles the question
  • Rollback is reassigning @Champion to the prior version
Anyone still describing Staging/Production stages on Unity Catalog is working from the old workspace registry model.
Governance & RegistryEnvironment PromotionDeploy code by default; promote artifacts only where genuinely required.

In plain terms

A model built this morning cannot reach customers this afternoon. It moves through separate environments, each with its own checks.

The route

  • Development — where it's built and experimented on
  • Test — validated against realistic data, reviewed by someone else
  • Live — only after passing everything before it

Why the separation is real

  • Each environment has its own permissions — the people who build are not automatically the people who can release
  • An experiment can't accidentally affect real customers
  • There's an auditable record of who approved what

Technical detail

Deploy code, not artifacts

  • Databricks recommends deploying ML pipelines as code — the training pipeline runs in the target environment and produces the model there
  • This removes a whole class of environment-mismatch bugs, since the model is built where it will run
  • Environments are separate catalogs, so promotion is expressed in the namespace

Where artifact promotion is still needed

  • copy_model_version() copies a version across catalogs where retraining in prod isn't viable
  • Requires read on source and write on destination — the permission boundary is the control
  • The alias is then set on the destination model to activate it
Serving & ActionBatch ScoringA scheduled Workflow producing scored output to Delta.

In plain terms

Every night the system scores the entire customer base. Each morning the team has a ranked list: who is most at risk, and which signals drove it.

Why the "why" matters as much as the score

  • "This customer is 80% likely to leave" prompts the question "so what do I do?"
  • "...mainly because their order frequency halved and they've raised three tickets this month" is actionable
  • Without the reasons, the list gets ignored within a fortnight — and this is the most common way a churn project quietly dies
Nightly is deliberately chosen. Churn risk doesn't meaningfully change minute to minute, and a nightly job is dramatically simpler and cheaper to run than a live service.

Technical detail

The job

  • Scheduled Databricks Workflow, loading the model by alias: models:/prod.ml_churn.churn_model@Champion
  • Features resolved through the Feature Store, so scoring uses the same definitions as training
  • Output written to a governed Delta table with model version and scoring timestamp stamped on every row

Explanations alongside scores

  • Per-prediction feature attributions computed and stored with the score
  • Adoption depends on this — a ranked list without reasons gets abandoned
Stamping the model version on every scored row is what makes retrospective Champion/Challenger comparison possible at all.
Serving & ActionReal-Time Model ServingA serverless endpoint, with inference tables feeding the monitoring loop.

In plain terms

Sometimes the answer is needed right now — a rep is on a call, or a customer is mid-way through cancelling online.

How it works

  • The same model is made available as a live service
  • Applications ask it for a score and get an answer in well under a second
  • Every request and response is logged automatically — which is what makes the self-monitoring possible
Deliberately marked optional. This adds meaningful cost and operational burden. It's the right choice only when a real workflow genuinely can't wait until tomorrow — and for many churn programmes, it can.

Technical detail

The endpoint

  • Serverless model serving, backed by the alias rather than a pinned version
  • Inference tables enabled — requests and responses land automatically in a governed Delta table
  • Online feature lookup by entity key, plus on-demand computation for request-time features

Why inference tables matter more than the latency

  • They are the substrate the entire monitoring loop is built on — inputs, predictions and later ground truth in one governed place
  • Without them, production behaviour has to be reconstructed from logs after the fact, if at all
Scoping honestly: justify real-time by a latency requirement in an actual workflow. Batch covers most churn programmes at a fraction of the cost.
Serving & ActionWrite-Back & Feedback LoopDelivery into existing tools, and outcome capture for the next training cycle.

In plain terms

This is where most ML projects fail, and it has nothing to do with the modelling.

A model can be excellent and still deliver nothing, because the predictions live in a system nobody opens. If a rep has to log into a separate tool to see risk scores, they won't.

So the scores go to them

  • Written back into the CRM, on the customer record the team already looks at daily
  • Surfaced on the dashboards management already reviews
  • High-risk, high-value accounts can trigger an alert rather than waiting to be noticed

And the results come back

  • What the team did about each flagged customer, and what happened afterwards, is recorded
  • That becomes training data, so the model learns from its own track record
  • It also answers the question that actually matters: is this making a commercial difference?
A model that changes no behaviour has no value, however accurate it is. Delivery is part of the architecture, not an afterthought.

Technical detail

Delivery paths

  • Scores written back to the CRM so they appear in the existing workflow, not a parallel one
  • AI/BI dashboards over the scored Delta table for management view
  • Threshold-based alerting for high-value at-risk accounts

The feedback loop

  • Intervention outcomes captured — what action was taken, and what followed
  • Those outcomes become future labels, so the model improves against reality rather than a frozen snapshot
  • Enables measurement of incremental retention lift, which is the number that justifies the programme
The honest measurement problem: once the business acts on predictions, a correctly-flagged customer who is then saved looks like a false positive. Holdout groups are the only clean way to measure real lift — and they have to be designed in from the start, not bolted on later.
PlatformUnity CatalogA single governance plane spanning data, features, models and predictions.

In plain terms

Customer data is sensitive, and predictions about customers are arguably more sensitive. One rulebook governs all of it.

What it controls

  • Who can see which data — down to individual columns, so an analyst can work with purchase patterns without seeing personal contact details
  • Automatic masking — the same table shows full detail to one team and hidden values to another, with no duplicate copies to keep in sync
  • Where everything came from — trace any prediction back through the model, the features and the source data
  • A complete audit trail — who accessed what, and when

Why the lineage genuinely matters

  • If a data quality problem is found, you can see exactly which models and reports were affected
  • Under GDPR-style rules, "explain how this decision was made" has a real answer
  • Changing an upstream table shows you what will break before you change it
Governance retrofitted onto a working ML system is painful and usually incomplete. Designed in from the start, it costs almost nothing.

Technical detail

What sits under UC governance

  • Delta tables across every medallion layer
  • Feature Views and feature tables
  • Registered models and versions
  • Inference tables and scored output

Capabilities used

  • Three-level namespacecatalog.schema.object, with catalog expressing environment
  • Fine-grained access control — row filters and column masks applied at query time
  • End-to-end lineage — table → feature → model → prediction as one graph
  • Audit logs across data and model access alike
The structural win: models and features are governed by the same system as the data, so there is one permission model to reason about rather than several that drift apart.
PlatformLakehouse Monitoring & RetrainingInference profiling over serving tables, with drift driving the retraining trigger.

In plain terms

Here's something rarely mentioned in ML sales pitches: every model gets worse over time. Not because it breaks, but because the world moves on.

Why it happens

  • Customer behaviour shifts — what predicted churn in 2024 may not in 2026
  • The business changes — new products, new pricing, new segments
  • An upstream system changes how it records something, and a signal quietly changes meaning

What this system does about it

  • Continuously compares today's customers to the ones the model learned from
  • Tracks whether predictions still match what actually happens
  • Raises an alert when either drifts beyond an agreed threshold
  • Can automatically start retraining — but a human still approves what goes live
Worth asking any ML vendor: "how will I know when this stops working?" A system that can't answer that will quietly degrade for months, and the business will keep acting on it the whole time.

Technical detail

Monitor configuration

  • Inference profile over the inference / scored table — the profile type built for model monitoring
  • Tracks model inputs, predictions and, once available, ground-truth labels
  • A baseline table pins the training distribution as the reference point

What it produces

  • A profile metrics table — summary statistics per window
  • A drift metrics table — statistical change versus baseline or the prior window
  • An auto-generated dashboard, plus alerts driven off the metrics tables

The retraining loop

  • Feature drift or a performance drop past threshold raises an alert and can trigger the training Workflow
  • The candidate registers as a new version and takes the @Challenger alias
  • Promotion stays a human decision — automated retraining, deliberately not automated deployment
Ground truth arrives late in churn — you only learn who left months afterwards. So input drift is the early warning, and outcome-based performance is the confirming signal that follows.
PlatformDatabricks Asset Bundles & CI/CDThe entire ML system declared as code and promoted through environments.

In plain terms

Everything here — the data jobs, the training, the schedules, the permissions — is written down as code rather than clicked together by hand.

Why that's worth insisting on

  • The whole system can be rebuilt from scratch if it ever needs to be
  • Every change is reviewed by another person before it goes live
  • Complete history of what changed, when and why
  • Test and live environments are genuinely identical, because both are built from the same definition
The practical test: if the person who built it left tomorrow, could someone else rebuild it? Here the answer is yes, because the system is the code.

Technical detail

What the bundle declares

  • Workflow definitions — training, batch scoring, monitoring refresh
  • Notebook and source paths, cluster and serverless configuration
  • Per-environment target variables — catalog names, schedules, endpoint sizing

The pipeline

  • Git-backed repo; every change is a branch and a pull request
  • CI validates the bundle and runs unit tests on feature and training logic
  • bundle deploy per environment target, driven from Azure DevOps — consistent with the existing release process
  • Environment differences live in bundle variables, never in edited copies of a notebook
This pairs with deploy-code-not-artifacts: the bundle deploys the training pipeline into the target environment, where it produces the model in place.
PlatformCompute & Cost DesignDeliberate compute choices — the difference between a viable programme and a cancelled one.

In plain terms

Cloud ML platforms are easy to overspend on. Most of the waste comes from machines left running that nobody is using.

Choices that keep this affordable

  • Compute starts when a job runs and stops when it finishes — nothing idles overnight
  • Nightly batch scoring instead of a live service, unless a live service is genuinely needed
  • Training runs on a schedule appropriate to how fast the data actually changes, not continuously
  • Machines sized to the actual work rather than to a worst case that never arrives
The largest single saving is architectural: choosing batch over real-time where the business doesn't need real-time. That one decision typically costs more than every tuning optimisation combined.

Technical detail

Compute strategy

  • Job compute, not all-purpose, for scheduled work — cheaper per unit and terminates on completion
  • Serverless where startup latency dominates runtime, avoiding idle spend entirely
  • SQL warehouses with auto-stop for the BI layer
  • Scoring frequency matched to how quickly churn risk actually moves — daily, not hourly

Where cost is really decided

  • Batch versus real-time is the dominant lever — an always-on endpoint costs continuously, a nightly job costs for minutes
  • Feature computation reused across training and scoring rather than recomputed per path
  • Retraining triggered by drift rather than by a fixed aggressive schedule
Cost per prediction is a legitimate architectural metric. Quoting it up front tends to be what separates a proposal that gets approved from one that stalls in procurement.
Design RationaleWhy This DesignOptimised for the failure modes that actually kill ML programmes.

In plain terms

Industry surveys consistently find that most machine learning projects never make it into production. Almost none of them fail because the maths was wrong.

What actually kills them

  • Nobody uses the output — it lives in a tool the team doesn't open
  • It quietly goes stale — accuracy decays for months and nobody notices
  • It can't be explained — someone asks why a customer was flagged and there's no answer
  • It can't be rebuilt — the person who made it left, and it existed only in their notebook
  • It was solving the wrong problem — churn was never properly defined at the start

Each of those has a deliberate answer here

  • Predictions go into the CRM the team already uses, with reasons attached
  • The system monitors its own accuracy and raises a flag when it slips
  • Every prediction is traceable back to the model, features and data behind it
  • The whole system is code, so it can be rebuilt by anyone
  • Defining churn is the first step, not an afterthought
In one line: the modelling is the easy part. This design puts its effort into the parts that actually decide whether an ML programme survives contact with a real business.

Technical detail

Optimised against real failure modes

  • Adoption — write-back into existing workflows, with per-prediction explanations; a standalone dashboard is an adoption risk, not a deliverable
  • Silent decay — inference profiling and drift metrics make degradation visible rather than assumed
  • Explainability — UC lineage spans data → feature → model → prediction as one graph
  • Bus factor — Asset Bundles make the system reproducible from source
  • Problem definition — label and horizon pinned in code before modelling starts

Deliberate choices worth defending

  • Batch-first — real-time serving is opt-in, justified by a latency requirement rather than assumed
  • Automated retraining, manual promotion — automating the expensive, repeatable half while keeping a human on the risky half
  • Champion/Challenger on realised outcomes — offline metrics inform, live outcomes decide
  • PR-AUC and precision@k — metrics matched to imbalance and to a fixed-capacity worklist

Trade-offs, honestly

  • Heavier upfront investment than a notebook that produces a scored CSV — and for a genuine one-off analysis, the notebook is the right answer
  • Feature Views constrain how features are expressed in exchange for managed pipelines and lineage
  • Holdout groups for measuring true lift cost some retention in the short term to prove the programme works at all
  • The monitoring loop only fully closes when ground truth arrives, which for churn is months later
Verdict: this is deliberately sized for a system meant to run for years and be defended to auditors — not for a proof of concept. The right architecture depends on which of those is being built.
Training · Step 1TriggerTwo entry points into the training pipeline.

In plain terms

Training doesn't run every night — that would be wasteful. It runs when there's a reason to.

Two reasons to retrain

  • Scheduled — a regular refresh, so the model keeps learning from recent customers
  • Triggered — monitoring noticed the model slipping and asked for a new one
The second is what makes this self-correcting. Most systems only ever retrain on a calendar, which means they stay stale in exactly the situations where staleness matters most.

Technical detail

Entry points

  • Scheduled — periodic refresh aligned to how fast the underlying behaviour moves
  • Drift-triggered — fired from the monitoring alert at step 13

Run context captured

  • Trigger reason is logged on the run, so a model version can always be traced to why it was built
Training · Step 2Label ConstructionLabels recomputed for the current window using the pinned definition.

In plain terms

Before a model can learn, it needs examples with known outcomes — customers who did leave, and comparable ones who didn't.

What happens here

  • The agreed churn definition is applied to the current window
  • Each example is stamped with the date it's being predicted from
  • The same definition is used every single time — it's in code, not in someone's head

Technical detail

Recomputed per run

  • Churn events resolved over the observation window using the version-controlled definition
  • Each row carries its observation timestamp, which step 3 depends on
  • Class balance logged — a sudden shift is itself a signal worth alerting on
Training · Step 3Training Set AssemblyPoint-in-time correct join between labels and features.

In plain terms

Each labelled example is matched with the signals as they looked on that date — never as they look now.

This is the step that decides whether the model works in production or only in testing. Get it wrong and the scores look wonderful and mean nothing.

Technical detail

Mechanism

  • Feature Store training set built with a point-in-time join on the observation timestamp
  • Feature lineage is captured automatically and travels with the model
  • The identical lookup logic is reused at scoring time, eliminating train/serve skew
Training · Step 4Train & TrackFit the candidate, log everything needed to reproduce it.

In plain terms

The model learns the patterns that separated customers who left from those who stayed.

Recorded automatically

  • Every setting used, and every score achieved
  • Exactly which data it learned from, and as of when
Worth saying plainly: this is the easy step. The steps either side of it are where projects succeed or fail.

Technical detail

Logged to MLflow

  • Hyperparameters, metrics, artifacts
  • Delta table version — reproducible via time travel
  • Model signature — required for Unity Catalog registration
  • Source revision from the deployed bundle
Training · Step 5Evaluation Against ChampionHead-to-head on a common holdout, using metrics fit for the problem.

In plain terms

"Newer" doesn't mean "better". The candidate is measured head-to-head against the model currently in charge, on identical data.

What's checked

  • Of the customers flagged, how many really do leave
  • Of those who leave, how many were caught
  • Whether it performs across all customer segments, not just the easy ones

Technical detail

Comparison

  • Both models scored on a common holdout — PR-AUC and precision@k as primaries
  • Calibration checked, since scores drive prioritisation
  • Slice analysis by tenure and value band — an aggregate gain hiding a segment regression is a fail
Training · Step 6Quality GateA hard branch — register as Challenger, or halt with an alert.

In plain terms

If the new model isn't better, the run stops here. The existing model carries on untouched and someone is told why.

Why an explicit stop matters

  • Automated retraining without a gate will eventually promote something worse
  • A failed gate is useful information — it usually means the data changed, not that the code broke
A pipeline that always produces a new live model is not an achievement. Knowing when not to is.

Technical detail

Branch logic

  • Pass — register a new version in UC, assign the @Challenger alias
  • Fail — halt, leave @Champion untouched, raise an alert with the comparison attached
  • Thresholds are explicit and version-controlled, not implicit in a notebook
Training · Step 7PromotionAlias reassignment as a reviewed, human action.

In plain terms

Everything up to here is automatic. This step is not, and that's on purpose.

Why keep a human here

  • The model affects how real customers are treated — someone should own that decision
  • Metrics can improve for reasons that are wrong — a person notices what a threshold can't
  • It creates an accountable, auditable record of who approved what
The principle: automate the expensive, repeatable work. Keep a human on the irreversible, risky decision. Reverting is one click either way.

Technical detail

The action

  • Reviewer inspects the comparison, then reassigns @Champion to the new version
  • No redeploy — serving and scoring resolve by alias, so the switch is instant
  • Rollback is reassigning the alias back; the prior version is untouched
Optionally the Challenger scores in parallel first, and promotion waits on realised outcomes rather than offline metrics alone.
Scoring · Step 8Load By AliasResolution by alias, never by pinned version.

In plain terms

The nightly job doesn't have a model built into it. It asks for whichever model is currently approved and uses that.

That indirection is why promoting a new model needs no change to the scoring job at all — and why rolling back is instant.

Technical detail

Why alias, not version

  • The job references @Champion, so promotion and rollback require no code change or redeploy
  • The resolved version number is logged on the run and stamped onto every scored row
Scoring · Step 9Batch Scoring & AttributionPredictions plus explanations, written together.

In plain terms

Every customer gets a risk score — and, just as importantly, the reasons behind it.

Why the reasons ship with the score

  • "80% at risk" prompts "so what do I do?"
  • "...because ordering halved and three tickets are open" is something a person can act on
Lists without reasons get ignored within a fortnight. This is the most common way a technically sound churn project quietly dies.

Technical detail

Output

  • Features resolved through the Feature Store — same definitions as training
  • Scores plus SHAP attributions written to a governed Delta table
  • Every row stamped with model version + scoring timestamp — the basis for later comparison
Scoring · Step 10Write-Back & PublicationDelivery into existing workflows, not a parallel one.

In plain terms

Scores are pushed into the CRM — onto the customer record the team already opens every day.

Where it lands

  • The CRM, on the record reps already work from
  • Management dashboards that already get reviewed
  • An alert for high-value accounts that cross the risk threshold
If someone has to log into a separate tool to see this, they won't. Delivery is part of the architecture, not an afterthought.

Technical detail

Publication paths

  • CRM write-back so scores appear inside the existing workflow
  • AI/BI dashboards over the scored Delta table
  • Threshold alerting for high-value at-risk accounts
  • Intervention outcomes captured back, becoming labels for a future step 2
Monitoring · Step 11Inference ProfilingMonitor refresh producing profile metrics per window.

In plain terms

After every scoring run, the system profiles what it just saw — the customers, their signals, and the predictions made.

This runs whether or not anyone is looking. That's the point: the failure mode being guarded against is nobody noticing.

Technical detail

What runs

  • Monitor with an inference profile over the scored table
  • Tracks model inputs, predictions, and ground-truth labels once they arrive
  • Emits a profile metrics table per window, plus an auto-generated dashboard
Monitoring · Step 12Drift ComputationStatistical comparison against the pinned training baseline.

In plain terms

Today's customers are compared against the customers the model originally learned from. If they've diverged, the model's assumptions are getting stale.

Two things tracked

  • Have the inputs changed? — the early warning, available immediately
  • Are the predictions still right? — the definitive answer, but it arrives months later

Technical detail

Computation

  • Drift metrics table — current window vs the pinned training baseline and vs the prior window
  • Input drift is the leading indicator; outcome-based performance confirms it later
Churn ground truth is inherently delayed — you only learn who left months afterwards. Acting on input drift first is what buys back that lag.
Monitoring · Step 13Alert & Retrain TriggerThe edge that turns a pipeline into a closed loop.

In plain terms

When drift or accuracy crosses the agreed line, an alert is raised — and training kicks off again from step 1.

What this gives the business

  • You find out the model is degrading from the system, not from a customer complaint
  • A replacement is already being prepared while you're reading the alert
  • But nothing reaches customers until a person approves it at step 7
Worth asking any ML vendor: "how will I know when this stops working?" This is that question, answered in the architecture rather than in a promise.

Technical detail

The closing edge

  • Alerts defined over the drift and profile metrics tables
  • Breach raises a notification and can fire the training Workflow at step 1
  • Thresholds are explicit and reviewed — too tight retrains constantly, too loose defeats the purpose
Automated retraining, manual promotion. The expensive repeatable half is automated; the risky half keeps a human on it.

The capability behind it

Start a conversation

Tell us what you are trying to build

Send the problem rather than a spec. We will tell you what it takes, who would work on it, and whether we are the right people for it.

Vijeesh TP

Vijeesh TP

Founder