, ,

The Data Science Lifecycle End to End, From Business Question to Retired Model (Data Science Series, Part 2)

Modelling was 11 percent of my last churn project. Here is the eight stage lifecycle that accounts for the other 89 percent, including the retirement stage almost nobody plans for.

Data Science Series · Part 2 of 30
Who this is for: Beginners who have read Part 1, and working analysts about to run their first modelling project. I still assume no machine learning knowledge here. I do assume the analyst groundwork covered in my Data Analyst Series: SQL, descriptive statistics, and basic exploration. There is no code in this part on purpose. This is the map you will refer back to for the next twenty eight parts.

Five percent. That is the share of the code in a mature machine learning system that is actually machine learning, according to the Google team who wrote the paper on hidden technical debt in ML systems. The other ninety five percent is configuration, data plumbing, validation, serving infrastructure and glue.

That number reframes the whole job. If you picture a data science project as fitting a model, you have pictured five percent of it and you will be surprised by the rest. The lifecycle in this part is the other ninety five percent laid out in order, from the first conversation with a stakeholder through to the morning you switch a model off on purpose. Every later part of this series slots into one of these stages, so it is worth knowing the shape of the whole thing before you learn any single piece of it.

Key takeaways

The lifecycle has eight stages and none of them run once. The two loops that matter are back to the business question, and back to the data.

Modelling is the shortest stage in almost every project I have run. On the churn project used across this series it took nine of eighty one working days.

A model does not end when it ships. It decays, and the stage everyone forgets to plan for is retirement.

Write the retirement criteria in the project brief on day one, before anyone has fitted anything. It costs an hour, and it is the most valuable hour in the whole project.

Why the lifecycle is a loop

The reference process most teams borrow from is CRISP-DM, the Cross Industry Standard Process for Data Mining, which is a six phase description of how a data project runs. It was written in 1996 by a consortium including NCR, Daimler and an insurer called OHRA, and it has outlived every framework that tried to replace it. IBM still ships it as the documented methodology for SPSS Modeler, and the documentation is blunt about the thing beginners get wrong: the sequence of the phases is not strict, and most projects move back and forth between phases as necessary.

I use an eight stage version because CRISP-DM was written before models routinely lived in production for years. It splits deployment from monitoring, and it adds a retirement stage that CRISP-DM folds into its outer circle. The stages are: frame the question, assess the data, prepare the data, engineer features, model, evaluate against the decision, deploy, then monitor and retire.

Read that list once and it looks like a pipeline. It is not. In practice you will walk two loops repeatedly. The first runs from evaluation back to framing, because the model answered the question you asked and the question was wrong. The second runs from feature engineering back to data assessment, because the feature you wanted turns out not to exist in a usable form before the moment of prediction. Both loops are normal. A project that never loops is usually a project where nobody checked anything.

flowchart TD
  S[Business question] --> A[Assess available data]
  A --> P[Prepare and clean]
  P --> F[Engineer features]
  F --> M[Fit and tune model]
  M --> E{Does it change a decision}
  E -->|No, wrong question| S
  E -->|No, weak signal| A
  E -->|Yes| D[Deploy to production]
  D --> O[Monitor drift and decay]
  O --> R{Still earning its keep}
  R -->|Yes, refresh| F
  R -->|No| X[Retire the model]
The eight stage lifecycle. The three arrows that point backwards are where the calendar actually goes.

Business understanding, where projects are won or lost

The first stage produces no data and no code. It produces a sentence. Somebody senior says something like: too many subscribers are cancelling and we want to do something about it. Your job is to convert that into a statement precise enough to be right or wrong.

Four questions do most of the conversion work. What decision changes because of this, and who makes it. When does the decision get made, which fixes how far ahead you must predict. What is the current rule, because you have to beat something and it is never nothing. And what does a wrong answer cost in each direction, because the cost of chasing a customer who was never going to leave is not the same as the cost of missing one who does.

That last one is where beginners most often skip ahead. Churn is the running project for this whole series, using the public Telco Customer Churn dataset that IBM publishes: 7,043 fictional customers of a Californian telco, one row each, with a column recording whether they left in the last month. Suppose a retention call costs about 12 dollars in agent time and the discount offered costs another 40, while a lost customer costs roughly 780 dollars in remaining contract value. Those three numbers, not the algorithm, decide what a good model looks like. They tell you that missing a churner is roughly thirteen times more expensive than bothering a loyal one, which means you will want a model tuned toward catching churners even at the cost of a lot of false alarms. We will make that concrete later in this series when we get to metric choice. For now, notice that the tuning decision was already made in stage one, by an accountant, before anyone opened a notebook.

The output of this stage should be one written page. Not a deck. A page that states the decision, the prediction horizon, the current baseline rule, the cost of each error type, and the conditions under which you would switch the model off. If I had to pick one artefact in this list to defend, it is the last line, and I will come back to why. The thing I would avoid is the kickoff deck full of proposed techniques. A deck that names gradient boosting before it names the decision is a project already drifting.

StageWho leads itWhat it producesCommon failure
Frame the questionData scientist with the business ownerA one page decision briefNo named decision maker
Assess the dataData scientist and data engineerA data inventory and gap listAssuming a field exists at prediction time
Prepare the dataData scientistA reproducible cleaned tableCleaning by hand in a notebook
Engineer featuresData scientistA documented feature setLeakage from the future
ModelData scientistA fitted, versioned candidateTuning before a baseline exists
EvaluateData scientist with the business ownerA decision, in money not accuracyReporting a metric nobody can price
DeployML engineerA scored population, on scheduleScores land where nobody reads them
Monitor and retireML engineer with the data scientistDrift alerts and a kill dateNobody owns it after launch
The eight stages, their owners, and the failure I see most often at each one.

Getting the data ready, which is most of the calendar

Stages two, three and four are data assessment, preparation and feature engineering. Together they consume more calendar time than everything else combined, and they are the stages that tutorials compress into a single tidy import.

Assessment asks a narrower question than people expect. It is not what data do we have. It is what data will exist, in this form, at the moment the prediction has to be made. Those are wildly different questions. On a churn project you will find a field recording the reason a customer gave for leaving. It is beautifully predictive. It is also written down after they leave, which makes it useless and dangerous. That is data leakage, meaning information that would not be available at prediction time bleeding into your training set, and it is the single most common way a model that looks brilliant in a notebook does nothing in production.

Preparation is the cleaning work: missing values, duplicate rows, categories spelled three different ways, numbers stored as text. I am not going to re-teach it, because I covered it properly for analysts in cleaning messy data, and the exploration habits in exploratory data analysis carry over unchanged. The one difference for a modeller is that your cleaning must be reproducible as code, because every step you perform by hand is a step that will not happen when the model runs on Tuesday morning without you.

Feature engineering is where a raw column becomes something a model can use: turning a signup date into tenure in months, a set of monthly charges into a trend, a support ticket count into a rate per month. It is the stage with the highest ratio of accuracy gained to effort spent, which is why it gets its own part later. It is also the stage where leakage sneaks back in through the side door, because an aggregate feature quietly computed over the whole dataset has already seen the future.

Where 81 working days actually wentOne subscription churn project, first model to production, my own project logFrame questionAssess dataPrepare dataEngineer featuresModelEvaluateDeployMonitor setup71322129611505101520Working days
Modelling was 11 percent of the project. Data work was 58 percent. This ratio has held on almost every project I have run.
Gotcha: Do not treat the 22 days of preparation as a one off tax you pay before the fun starts. Roughly a third of it happened after the first model was fitted, when evaluation exposed a column that was not what its name claimed. Budget for the loop, not for a straight line, and tell your stakeholder in week one that the estimate will move.

Modelling and evaluation against a decision

A model, in the plainest terms, is a mathematical rule fitted to past examples that produces a number for a case it has not seen. Fitting one is the stage everybody imagines the job to be, and on the project above it took nine days out of eighty one.

Two habits keep this stage short and honest. Start with a baseline you can beat: the current business rule, or a model so simple it takes ten minutes. If your gradient boosted ensemble beats a plain logistic regression by two points, you have learned that the ensemble is not worth its operational cost, which is a genuinely useful result. Second, decide how you will measure success before you fit anything, and write it down. Otherwise you will fit five models, pick the metric each one happens to win on, and quietly fool yourself.

Evaluation is a separate stage from modelling for a reason. Modelling asks whether the model fits the data. Evaluation asks whether the model changes a decision profitably. Those come apart more often than you would think. A model can be measurably better than the baseline and still be worth nothing, because the retention team can only make 400 calls a week and the old rule already gave them 400 names worth calling. Improving the ranking below position 400 changes nobody Monday morning. This is also where the analyst discipline of separating correlation from causation earns its keep: a model that ranks who will churn does not tell you who can be persuaded to stay, and those are two different lists.

War story

On a subscription churn build a few years ago I shipped a model that scored customers as likely to leave within 30 days. It validated cleanly. It went live. Six weeks later the retention lead told me the calls were not converting.

The cause had nothing to do with the model. Scores were written to a table on the first of the month, pulled into the campaign tool on the eighth, and dialled from the fifteenth. By the time an agent rang, the 30 day window was half gone and a chunk of the list had already cancelled. The model was answering a question about day zero and the business was acting on day fifteen.

The fix took one afternoon: retrain on a 60 day horizon and move the scoring job to weekly. Conversion on the retention calls went from about 9 percent to 14 percent, with no change to the algorithm at all. I had spent five weeks on features and had never once asked how many days passed between the score being written and a human acting on it. It is now the fourth question in my project brief.

GateQuestion it answersChurn project thresholdIf it fails
FeasibilityDoes signal exist at allBeat random ranking by any marginStop. Report honestly.
BaselineDoes it beat the current ruleCatch 15 percent more churners at the same call volumeKeep the rule. Cheaper.
EconomicsDoes it pay for itselfNet saving above 40,000 dollars a yearShelve until costs change
OperabilityCan the team act in timeScore to action gap under 7 daysFix the process first
RetirementWhen do we switch it offLift below 8 percent for two monthsRetrain, then retire
Five gates written into the brief on day one. The last two are the ones teams skip, and the last two are the ones that saved this project.

Deployment, monitoring and the silent decay

Deployment means getting a prediction to the place a decision is made, on the schedule that decision runs. That can be a nightly batch job writing scores to a table, an API answering in 50 milliseconds while a page loads, or a streaming job scoring events as they arrive. Google Cloud describes three levels of MLOps maturity for this, from level 0 where every step is manual and script driven, through level 1 where the training pipeline itself is automated so models retrain continuously, to level 2 where the pipeline has its own CI/CD. Most teams reading this are at level 0, and that is a reasonable place to ship a first model from. It stops being reasonable around the third model.

Then the model starts to get worse, and nothing tells you. This is the failure mode that makes machine learning different from ordinary software. A broken web service throws errors. A decayed model returns perfectly well formed numbers that are increasingly wrong. The world moves: a competitor launches a cheaper plan, the company changes its pricing tiers, an upstream team renames a column and fills it with nulls. Nothing crashes. The scores just quietly stop meaning what they meant.

Which brings me to the stage nobody plans. Retirement. In every organisation I have worked with that has run models for more than about three years, there are models still scoring that nobody has evaluated since launch and nobody will own up to. They cost compute, they carry risk, and they influence decisions on the strength of a relationship that stopped holding two years ago. The reason they survive is simple: no one wrote down what would make them wrong. Deleting a model feels like admitting failure unless the criteria for deleting it were agreed before anyone was proud of it.

A model decaying in silenceLift over the baseline rule, churn model, months since launch. No alert fired.252015105Lift percentRetirement gate, 8 percent23 at launch0246810Months since launch
No single month looked alarming. Eleven of them together took the model below the gate agreed on day one.

Look at that chart month by month and nothing is wrong. Month four to month five is a drop of about one and a half points, well inside noise. The decay is only visible against a line drawn eleven months earlier. That is the whole argument for writing the retirement gate into the brief on day one: it is the only moment in the project when you are objective about it.

stateDiagram-v2
  [*] --> Candidate
  Candidate --> Shadow : passes offline gates
  Candidate --> Rejected : fails baseline
  Shadow --> Live : matches offline results
  Shadow --> Candidate : gap on live data
  Live --> Degraded : lift below gate
  Degraded --> Candidate : retrain
  Degraded --> Retired : no longer pays
  Live --> Retired : decision removed
  Retired --> [*]
The five states a model occupies after it leaves your laptop. Most teams only build the path into Live.

Map the whole loop before you open a notebook

My recommendation for this part is narrow and concrete: before your next project starts, write the one page decision brief, and make sure it contains the score to action gap and the retirement gate. Those two lines take fifteen minutes to write and they are the two that would have saved me five weeks on the project in the war story above.

The thing I would avoid is the pattern that feels most productive and is not: opening the data first. Loading a CSV and starting to explore is enormously satisfying, and it commits you to whatever question that particular table happens to be able to answer. I have watched capable people spend a month producing an excellent answer to a question nobody had asked, because the data was there and the brief was not.

Keep the eight stage loop somewhere you can see it. As this series progresses, every part lands on it: the Python environment work is what makes stages three and four reproducible, feature engineering is stage four, everything from linear regression through gradient boosting is stage five, model evaluation and leakage is stage six, serving and feature stores are stage seven, and drift monitoring is stage eight. Knowing which stage you are standing in is most of what separates a project that ships from one that quietly stops.

My take: If I could enforce one rule across every data science team I have worked with, it would not be about code quality or model choice. It would be that no model goes to production without a written kill condition and a named person who checks it quarterly. Every zombie model I have found was born from an unwritten assumption that someone else was watching.

Part 3 gets practical. We set up a Python environment that will still work in six months, with virtual environments, notebooks used deliberately rather than as a scratchpad, and the reproducibility habits that make stage three of this lifecycle survivable. That is the last piece of scaffolding before we touch the churn data in Part 4.

Your move: Take the question you wrote down at the end of Part 1 and turn it into the one page brief. Decision, decision maker, prediction horizon, current baseline rule, cost of each error type, score to action gap, retirement gate. If you cannot fill in the baseline rule, that is your finding, and it is worth more than a model.
Data Science Series · Part 2 of 30
« Previous: Part 1  |  Guide  |  Next: Part 3 »

References

About The Author


Discover more from Journal of Intelligent Infrastructure – By Dr Pranay Jha

Subscribe to get the latest posts sent to your email.

Leave a Reply

Your email address will not be published. Required fields are marked *

Architect’s Toolkit

About the Author

Dr. Pranay Jha is a Cloud and AI Consultant with 18+ years of experience in hybrid cloud, virtualization, and enterprise infrastructure transformation. He specializes in VMware technologies, multi-cloud strategy, and Generative AI solutions. He holds a PhD in Computer Applications with research focused on Cloud and AI, has published multiple research papers, and has been a VMware vExpert since 2016 and a VMUG Community Leader.

Discover more from Journal of Intelligent Infrastructure - By Dr Pranay Jha

Subscribe now to keep reading and get access to the full archive.

Continue reading