Tutorial T-08 · Unit 1
The Machine Learning Lifecycle
Most of what determines whether a machine learning project succeeds happens before any model is trained and after any model is deployed. This tutorial introduces the eight stages that well-run projects pass through, and explains why the process is iterative rather than linear — and why most of it is not modelling.
01 Learning Objectives
By the end of this tutorial you will be able to
- Name the eight stages of the machine learning lifecycle and describe what happens in each.
- Explain why the lifecycle is iterative rather than linear, and give examples of when a project moves backwards.
- Describe the approximate proportion of effort that real projects spend on each stage, and why modelling is a small fraction.
- Explain how the lifecycle reduces the failure modes described in T-07.
- Map the stages of the lifecycle onto the modules of this course, so you understand why the course is organised the way it is.
- Apply the lifecycle to a new project idea — identifying what would need to happen at each stage and where the biggest risks lie.
02 Motivating Example
Two teams at the same company are given the same task: build a model to predict which customers are about to cancel their subscription. Both teams have the same data, the same tools, and roughly the same level of skill.
Team A begins immediately. They take the customer database, pick a classification algorithm, split the data into training and test sets, and train a model. It achieves 91% accuracy. They deploy it. Within a month, the company notices that the model's predictions are not matching what the customer retention team is seeing. Half the customers the model flags as “about to leave” had just renewed their subscriptions. And the retention team is spending time on customers who were never going to cancel anyway.
Team B begins by asking questions. What does “about to cancel” actually mean — someone who has clicked a cancel button, or someone whose usage has dropped sharply, or someone whose contract is nearly up? What decision will the model support, and how much time does the retention team have to act on each prediction? What data exists about customers who did cancel, and how was that data collected? Which customer segments matter most?
After two weeks of this work, Team B discovers something Team A never noticed: the customer database contains a field called last_support_ticket that is only populated after a customer has contacted support to cancel. Team A had used this field as a feature. Their model was trivially accurate because it had found a field that leaked the outcome — a textbook case of the data leakage failure from T-07. Team B, having asked what each field actually meant and when it was recorded, excluded it. Their model achieves 78% accuracy, but it is measuring something real.
The difference between the two teams is not skill or effort. It is process. Team B followed the machine learning lifecycle; Team A skipped it.
03 Concept Explanation
The machine learning lifecycle is a structured process for building and maintaining machine learning systems. It has eight stages. Well-run projects move through them in roughly this order, but they also loop back: discovering a problem at stage 6 frequently sends a team back to stage 2.
Stage 1: Problem framing
Before touching data or algorithms, define precisely what problem the system is being asked to solve. This sounds obvious and is almost always the stage that teams rush through.
The key questions are: What decision will this model support? Who will act on its predictions, and what will they do differently? What does success look like, in measurable terms? What is the cost of being wrong?
In the churn example, Team B's questions were all framing questions. What does “about to cancel” mean? Which segments matter? How much time does the retention team have? Every one of these determines what data is needed, what the label should be, and how the model should be evaluated.
Framing problems are the most common cause of machine learning projects failing without ever technically failing. A model that accurately predicts the wrong thing is still useless.
Stage 2: Data collection
Once the problem is framed, you need data. Where will it come from? How much do you need? Is the data available at all, and if not, how will you obtain it?
This stage is often the most underestimated. Real datasets almost never exist in the form you need them. If you need labelled examples, someone has to label them — which is expensive, slow, and error-prone. If you need data from multiple sources, you have to reconcile them. If you need more data than exists, you may have to collect it yourself or decide the project is not viable.
Data collection is also where legal, ethical, and privacy considerations surface. Do you have the right to use this data? Have the people it describes consented? Will the way you collect it bias the results? These questions are not optional, and they are much easier to answer before collection begins than after.
Stage 3: Data preparation
Raw data is almost always messy. Missing values, inconsistent formats, duplicate records, outliers, and errors are the norm, not the exception. Data preparation means cleaning the data and shaping it into a form a model can learn from.
Typical activities include: handling missing values (drop, impute, or flag them); converting categorical variables into numerical form; normalising or standardising numeric features so they are on comparable scales; removing duplicate records; correcting errors; and splitting the data into training, validation, and test sets.
This stage is where a large fraction of the total project time is spent, and where many of the failure modes from T-07 originate. Data leakage usually happens here, when a feature is included that should not be. Spurious correlation often originates here, when a dataset is shaped in a way that accidentally encodes the wrong pattern.
Stage 4: Exploratory data analysis
Before training a model, look at the data. Compute basic statistics. Plot distributions. Check for correlations. Look for unexpected patterns or anomalies. This is the stage where you develop intuition about what the model will be able to learn.
Exploratory analysis is often the stage that reveals problems early. If the classes are extremely imbalanced, you want to know that before training. If a feature has an odd distribution, you want to know why. If two features are almost perfectly correlated, you may only need one of them.
It is also the stage that catches the husky/wolf problem. Plotting the data — and, ideally, looking at individual examples — is often how practitioners discover that the correlations the model will find are not the ones they intended.
Stage 5: Feature engineering and model selection
Now comes the stage most people think of as machine learning: choosing what the model should look at and which algorithm it should use.
Feature engineering is deciding which aspects of the raw data the model should use as inputs, and in what form. Sometimes this means selecting a subset of existing columns. Sometimes it means constructing new features — for example, converting a raw date into day-of-week, month-of-year, and is-holiday. Sometimes it means transforming a feature, such as taking the logarithm of a skewed numeric column.
Model selection is choosing the algorithm. Despite the attention it receives, this is usually the least consequential decision in the lifecycle. For many problems, several algorithms will give similar results, and the differences between them are small compared to differences in data quality or feature engineering. This is why the course spends two modules (Module 2 and Module 3) introducing algorithms and four modules on everything else.
Stage 6: Model training and evaluation
Train the chosen model on the training data, evaluate it on the validation data, and iterate. This is where the training loop from T-05 actually runs, and where the bias–variance tradeoff from T-07 becomes practically important.
Evaluation means much more than Computing accuracy. It means asking: does the model perform well on subgroups, or only on average? Is it calibrated — when it says 80% confident, is it right 80% of the time? Does its performance hold up under cross-validation? Does it meet the requirements established back at stage 1?
The most common reason a project loops backward from this stage is that the model performs well but does not answer the question the project was actually asked. That is not a modelling failure — it is a framing or feature engineering failure, and it sends the team back to an earlier stage.
Stage 7: Deployment
A model that stays in a notebook has no value. Deployment means integrating the model into whatever system will actually use it: a web application, a mobile app, a batch processing job, or an internal dashboard.
Deployment raises questions that do not arise during modelling. How fast does the prediction need to be? Does it need to run on every request, or can it be precomputed? How will the model's inputs be supplied at prediction time, and how do they differ from the training data? What happens if the model is unavailable — is there a fallback?
Many projects that succeed at modelling fail at deployment. The model is accurate but too slow; the inputs it needs are not available at serving time; the infrastructure team cannot support the framework it was built in. These are the concerns of Module 6, and they are just as important as the modelling itself.
Stage 8: Monitoring and maintenance
Once deployed, a model does not stay good forever. The world changes, and the model's assumptions gradually stop holding. Distribution shift, in the terms of T-07, is not a possibility but a certainty.
Monitoring means watching the model's behaviour in production: how often does it make predictions? How do its outputs compare to what was expected? Have the input distributions shifted? Are the outcomes still matching the predictions? Are downstream systems or users reporting problems?
Maintenance means acting on what monitoring reveals: retraining the model on fresh data, adjusting thresholds, replacing features that have become unreliable, or retiring the model entirely if the problem has changed beyond what it can address.
Monitoring and maintenance are not a single stage but an ongoing commitment. A deployed machine learning system is never finished; it is a living component that requires continued attention for as long as it is used.
Why the lifecycle is iterative
The eight stages are presented in order, but no real project moves through them in a straight line. Most projects loop backward multiple times. A few common examples:
- From evaluation back to problem framing. The model works, but it turns out to be answering the wrong question.
- From evaluation back to data collection. The model performs well on the training data but poorly on subgroups. More data for those subgroups is needed.
- From monitoring back to data preparation. A deployed model is behaving strangely, and the cause turns out to be a change in how the upstream data is formatted.
- From deployment back to problem framing. The model works technically, but nobody uses it, because the predictions are not actionable in the way the users actually work.
This is not a sign that the process has failed. It is what the process is for. Each loop back is a discovery that reduces the risk of a much larger failure later.
Where the time actually goes
One of the most surprising things for newcomers to machine learning is how little of a real project is spent on modelling. Across industry surveys, the rough distribution of effort is:
- Problem framing: 5–10%
- Data collection: 10–20%
- Data preparation and exploration: 30–40%
- Feature engineering: 10–20%
- Model training and evaluation: 5–15%
- Deployment: 10–15%
- Monitoring and maintenance: ongoing, often 10–20% per year of the system's life
The exact numbers vary by project, but the shape is consistent: data work dominates, and modelling is a small fraction. This is why the course spends Unit 2 on data fundamentals and Unit 3 on the Python ecosystem before introducing any algorithms.
04 Visual Illustration
The diagram below shows the eight stages arranged in a cycle rather than a line. The arrows between adjacent stages show the normal flow of work, but the dashed arrows across the centre indicate the most common loops back: from evaluation to earlier stages, and from monitoring back to the beginning.
A note on the shape
The circular layout is deliberate. A linear diagram of the lifecycle is misleading, because the process is not something you do once. Every deployed model eventually needs retraining, every retraining goes through the same stages again, and every project that discovers a problem at stage 6 goes back to an earlier stage to fix it. The circle is closer to how the process actually feels.
05 Worked Example
Let us walk through the churn prediction project from the motivating example, this time as Team B would have approached it. The goal is to see what each stage actually involves, and where the value of following the process comes from.
Customer churn prediction, stage by stage
Stage 1: Problem framing (one week). Team B meets with the retention team to understand how they work. They learn several things:
- The retention team can only contact about 200 customers per week.
- They have the most success with customers who have been with the company for over a year and whose usage has dropped in the last 30 days.
- Someone who has already clicked “cancel” is not worth contacting — they have decided.
- The company's main concern is losing high-value long-term customers, not low-value ones.
This changes the problem. It is not “predict who will cancel”. It is “predict which high-value customers are beginning to disengage, so the retention team can contact the 200 most at-risk customers per week”. This is a very different problem, with a very different objective.
Stage 2: Data collection (one week). Team B identifies what data exists and what is missing. They find:
- Two years of customer activity logs.
- Subscription records including start dates, plan changes, and cancellations.
- Support ticket history.
- Weekly usage statistics.
They also find that the customer database does not have a clean definition of “high-value”. They work with the retention team to define one: customers with over a year of tenure and a monthly spend above a threshold.
Stage 3: Data preparation (three weeks). This stage takes the longest, as it usually does. Activities include:
- Reconciling customer IDs across three different systems.
- Handling missing values in the usage logs, which have gaps during outages.
- Removing duplicate support ticket records created by a bug in the ticketing system.
- Discovering the
last_support_ticketfield and recognising that it leaks the outcome — it is only populated when someone contacts support to cancel. The field is excluded. - Splitting the data by time — training on months 1–18, validating on months 19–21, testing on months 22–24.
Stage 4: Exploratory analysis (one week). Team B plots distributions and checks for problems. They find:
- Only 3% of customers in any given month cancel, so the classes are highly imbalanced. This confirms that accuracy will be the wrong metric.
- Usage decline — a drop in activity over the prior 30 days — is strongly associated with future cancellation.
- Customers on a legacy plan cancel at much higher rates than others, which is a useful signal but also a business problem the retention team should know about.
Stage 5: Feature engineering and model selection (one week). Based on the exploratory analysis, Team B engineers features including:
- 30-day usage trend, as a percentage change.
- Number of logins in the past week.
- Days since last support contact.
- Plan type, tenure in months, and monthly spend.
For the model, they choose a gradient boosted tree (a type of ensemble model you will meet in Module 3). They choose it because it handles tabular data well, produces feature importances that they can show the retention team, and is fast to retrain.
Stage 6: Training and evaluation (one week). The model is trained and evaluated. Team B does not report a single accuracy number. Instead, they report:
- Precision at the top 200 predictions per week — that is, of the 200 customers the model flags as most at-risk, how many actually cancel?
- Recall of at-risk customers in the high-value segment — of the high-value customers who actually cancel, how many were flagged before they did?
- Feature importances, so the retention team can sanity-check what the model is using.
The model achieves 62% precision at the top 200, which is much better than the retention team's current heuristic of “contact customers whose usage dropped last week” (which has 31% precision).
Stage 7: Deployment (two weeks). Team B works with engineering to deploy the model. It runs as a batch job every Monday morning, scoring all active customers and producing a ranked list of the top 200 at-risk customers, which is delivered to the retention team's dashboard. The scoring is not real-time because the retention team only acts on a weekly cadence.
Stage 8: Monitoring and maintenance (ongoing). Team B sets up monitoring:
- Weekly reports on precision at the top 200, based on which flagged customers actually cancelled in the following month.
- Monthly checks that the input feature distributions have not shifted dramatically.
- A quarterly retraining schedule, plus the ability to retrain immediately if monitoring shows a performance drop.
The outcome. Twelve months later, the model is still in use. Its precision has drifted from 62% to 55%, and Team B has retrained it twice to keep it at that level. It is not perfect. But it is measurably better than the heuristic it replaced, and the retention team has seen a modest improvement in the customers they manage to keep.
Notice how little of this story involves modelling. Team B spent nine weeks on the project, of which one week was spent on feature engineering and model selection and one week on training and evaluation. The other seven weeks were spent on framing, data collection, data preparation, exploratory analysis, and deployment. And the process did not end when the model was deployed; it continues for as long as the system is in use.
06 Interactive Activity
Where in the lifecycle?
Each scenario below describes something that happened during a machine learning project. Identify which stage of the lifecycle the scenario belongs to. Some scenarios involve a loop back to an earlier stage — if so, note both the stage where the problem was discovered and the stage the team needs to return to.
| # | Scenario | Stage |
|---|---|---|
| 1 | A team decides that instead of predicting a customer's exact future spend, they will predict which spend bracket the customer will fall into, because the business only needs the bracket. | |
| 2 | A data engineer notices that 12% of the records are missing a value for one specific field, and decides to add a “was_missing” indicator column rather than imputing the value. | |
| 3 | A team plots a histogram of a feature and discovers it has a long right tail, so they decide to apply a log transformation before using it. | |
| 4 | The model performs well in testing, but when it is put into production the team realises it takes 8 seconds to score a single record, which is too slow for the intended use case. | |
| 5 | Six months after deployment, monitoring shows that the distribution of a key input feature has shifted significantly, and the model's precision has dropped from 78% to 64%. | |
| 6 | A team decides to obtain labelled training data by hiring annotators to review 10,000 historical records. | |
| 7 | A team compares logistic regression, random forest, and gradient boosting on the same data, and finds that all three achieve similar performance. | |
| 8 | A team discovers that one of their features is strongly correlated with the target on the training data, but the correlation disappears when they look at the validation data. | |
| 9 | The team works with the legal department to confirm that the customer data can be used for modelling under the company's privacy policy. | |
| 10 | After deployment, the team sets up an alert that fires if the model's weekly prediction count drops by more than 20%. | |
| 11 | A team realises that their model is accurate overall, but much less accurate for a particular customer demographic, which would make it unusable in production. | |
| 12 | Analysts meet with the end users of the system to understand what decision they make and how much time they have to make it. |
Show suggested answers
1. Problem framing. The team is refining what problem they are solving based on what the business actually needs.
2. Data preparation. Handling missing values is a standard data preparation task. Adding an indicator column is a particularly good practice when missingness itself might be informative.
3. Exploratory data analysis (leading to feature engineering). The plotting belongs to analysis; the decision to transform the feature belongs to engineering. This is a normal transition between the two stages.
4. Deployment, looping back to problem framing. The model is technically working but does not meet the operational requirements. The team needs to either find a faster model or reframe the problem to something that does not require real-time scoring.
5. Monitoring, looping back to data preparation or retraining. The monitored degradation indicates that the model needs to be retrained, and the team should investigate whether the shift in the input distribution is caused by a data pipeline change (data preparation issue) or a genuine change in the world (which just requires retraining).
6. Data collection. Obtaining labelled data is explicitly stage 2.
7. Model selection (part of stage 5). Comparing algorithms is a normal activity here. Note that this scenario is exactly what the tutorial describes: for many problems, several algorithms give similar results, and the choice between them is not very consequential.
8. Training and evaluation (stage 6), looping back to data preparation or feature engineering. A feature that correlates with the target in training but not in validation is a classic sign of either leakage or a distribution difference between the two splits. The team should investigate where the feature came from and whether the split was done correctly.
9. Data collection (stage 2). Legal and privacy checks are part of determining whether the data can be used at all.
10. Monitoring and maintenance (stage 8). Setting up alerts on production behaviour is a monitoring activity.
11. Training and evaluation (stage 6), looping back to problem framing or data collection. The model is accurate overall but not for a subgroup. This could require more data for that subgroup (stage 2), a different evaluation criterion (stage 1), or rethinking whether the model should be used at all.
12. Problem framing (stage 1). Understanding the decision context is the first step of the lifecycle.
07 Self-Check Questions
Try each question before revealing the answer. If you get one wrong, re-read the section it refers to before continuing.
Question 1
According to the tutorial, which stages of the lifecycle typically consume the largest fraction of a real project's time?
Show answer
B. Data preparation and exploratory analysis typically take 40–60% of a project's total time. This is the single most surprising statistic for people new to the field, and it is the reason the course spends Unit 2 on data fundamentals before introducing any algorithms.
Question 2
Why is the machine learning lifecycle drawn as a cycle rather than a straight line?
Show answer
B. The circular shape reflects two facts: real projects loop backward when problems are discovered, and deployed models are periodically retrained, which means going through the same stages again. This is not a failure of the process — it is what the process is for.
Question 3
In the churn prediction example, what stage of the lifecycle did Team B perform that Team A skipped, leading to Team B avoiding the data leakage problem?
Show answer
B. Team B's careful data preparation — including
asking what each field means and when it is recorded — is what
let them identify the last_support_ticket field as a leak.
Team A skipped this stage and used the field without understanding it.
Question 4
A team discovers at the evaluation stage that their model performs well overall but poorly on a specific subgroup of users. What is the most likely next step?
Show answer
B. The problem is almost never fixed by changing the algorithm. Poor performance on a subgroup usually means the training data is unrepresentative, the problem was framed in a way that hides the subgroup's needs, or the evaluation metric is not capturing what matters. All of these require looping back to an earlier stage.
Question 5
Why is the model selection stage described as the least consequential decision in the lifecycle?
Show answer
B. This is one of the recurring themes of the course. Data quality and feature engineering dominate the outcome; the choice between, say, a random forest and a gradient boosted tree is usually small compared to the difference between good and bad features. This is why the course spends so much more time on data (Unit 2) than on algorithm comparison.
08 Practice Exercises
-
Name the stage. For each activity, state which stage of the
lifecycle it belongs to.
- Meeting with the end users to understand how they will act on the model's predictions.
- Adding a “was_missing” column to preserve information about missing values.
- Plotting a histogram to check the distribution of a feature.
- Setting up an alert that fires if the model's weekly prediction count drops by 20%.
- Comparing logistic regression and gradient boosting on the same dataset.
- Order the stages. Place the following stages in the correct order: deployment, problem framing, data collection, training and evaluation, exploratory analysis, monitoring, data preparation, feature engineering.
-
Identify the loop back. For each scenario, identify the stage
where the problem was discovered and the stage the team should return to.
- The model performs well overall but poorly on a specific subgroup.
- The model is accurate but takes 8 seconds per prediction, which is too slow.
- Monitoring shows the model's accuracy has dropped by 15% over six months.
- Estimate the time. For a six-month machine learning project, roughly how many weeks would you expect to be spent on each stage? Justify your estimates with reference to the industry figures from this tutorial.
09 Problem Sets
Analytical problems
-
A financial services company wants to build a model to detect money laundering. Currently, compliance officers manually review 500 transactions per day, of which about 2% are eventually confirmed as suspicious.
(a) What are the key questions the team should ask at the problem framing stage? (b) What data would they need to collect? (c) What are the two most important failure modes this system would be vulnerable to from T-07? (d) How would you evaluate whether the system is a success, given that the compliance officers are already reviewing transactions?
-
The tutorial describes nine weeks of work for the churn project, of which only two were spent on modelling. Is this a fair distribution? Argue either for or against the claim that the lifecycle spends too much time on non-modelling activities.
-
A team is building a system to predict equipment failure in a factory. There are 200 machines, each with 50 sensors. Sensors report readings every ten seconds. In the past three years, there have been 30 failures.
(a) What are the biggest challenges at the data collection stage? (b) What stage of the lifecycle is likely to take the longest, and why? (c) How would you approach the class imbalance problem? (d) What stage would you be most concerned about, given the small number of positive examples?
-
The tutorial identifies five common loop-backs in the lifecycle. Identify three additional loop-backs not mentioned in the tutorial and describe a scenario that would trigger each one.
Technical problems
-
A team has built a model that performs well during development but has the following characteristics once deployed:
- The model is 500MB in size, and inference takes 2 seconds per request.
- The system receives 100 requests per second.
- The model's inputs include several features that are computed by a batch job that runs nightly.
(a) What specific deployment problems does this system face? (b) Which of these problems originate in the modelling stage and which in the deployment stage? (c) What changes would you recommend at each stage to address them?
-
Consider a model whose input distribution has drifted such that the mean of a key feature has shifted by 30% since training. Write pseudocode for a monitoring system that would detect this drift and trigger an alert. Your system should:
- Track the distribution of each feature over time.
- Compare the current distribution to the training distribution.
- Trigger an alert when the divergence exceeds a threshold.
- Avoid false alarms from normal fluctuations.
-
A team's model has the following performance metrics on a held-out test set:
Metric Overall Group A Group B Accuracy 0.86 0.91 0.72 Precision 0.84 0.89 0.68 Recall 0.79 0.86 0.61 (a) Is this model ready for deployment? Justify your answer. (b) Which stage of the lifecycle would you return to, and why? (c) What additional data would you want to see before making a decision? (d) If the discrepancy between groups could not be resolved, would you deploy the model? What alternatives would you consider?
Theoretical questions
- The tutorial presents the lifecycle as a framework for reducing risk. But some projects fail even when they follow the process carefully. What kinds of failures does the lifecycle not protect against?
- The lifecycle stages are presented as discrete. In practice, real projects often work on multiple stages in parallel. What are the implications of this for how the process should be managed?
- Problem framing is described as the most underrated stage. Why do you think this is? What incentives in a typical organisation push teams to skip or rush the framing stage?
- The distribution of effort across stages is described as an average across industry. For which kinds of projects would this distribution be most different? Consider research projects, consumer products, and safety-critical systems.
- The lifecycle includes monitoring and maintenance as the final stage, but monitoring and maintenance are ongoing. Is the “stage” framing appropriate, or does it misrepresent the ongoing nature of this work?
10 Discussion and Projects
Discussion questions
- Team B in the churn example spent two weeks on problem framing before touching data. Team A began modelling immediately. In a business environment where time-to-delivery is often pressured, how would you justify the two weeks of framing to a manager?
- The lifecycle suggests that most of the work is data-related. If this is true, why do you think machine learning is so often portrayed in popular media as being primarily about algorithms?
- A deployed machine learning system requires ongoing maintenance. Who should be responsible for this maintenance, and how should it be funded? Is monitoring the same kind of work as initial development?
- Some companies deploy models without rigorous evaluation, and rely on user feedback to identify problems. Is this acceptable for some applications but not others? Where would you draw the line?
- The tutorial presents the lifecycle as a way to reduce risk. But following the lifecycle slows down deployment. How should teams balance the desire to ship quickly against the risk of doing it wrong?
Case study: the Zillow Offers failure
Case study
In 2018, the real estate company Zillow launched Zillow Offers, a service that would use machine learning to buy homes directly from sellers, make minor repairs, and resell them. The pricing model estimated the fair market value of each home, and Zillow would make an offer based on that estimate.
The business depended on the accuracy of the pricing model. If the model overestimated a home's value, Zillow would buy it at too high a price and lose money on the resale. If it underestimated, the seller would refuse the offer, and Zillow would not acquire the home.
In 2021, Zillow announced it was shutting down Zillow Offers. The company had lost over $500 million in a single quarter. The pricing model, which had performed well in backtesting on historical data, had failed systematically in live operation. The market shifted rapidly during the COVID pandemic, and the model continued to make offers based on patterns that no longer held.
In addition, the model's behaviour created a feedback loop: when Zillow bought homes in a neighbourhood, it changed the local market, which affected the model's future predictions about the same neighbourhood. This effect was not present in the historical training data.
Analysis questions:
- Which stages of the lifecycle did Zillow most obviously fail at, based on this account?
- The pricing model performed well in backtesting. What does this tell you about the difference between backtesting and deployment?
- Distribution shift during COVID is described as a contributing factor. Which failure mode from T-07 does this correspond to?
- The feedback loop is described as not being present in the training data. How would you design an experiment to detect this kind of feedback effect before deploying?
- Was Zillow's failure avoidable, or is it inherent to any business that uses machine learning for high-stakes decisions?
Critical-thinking activity: plan a project
Activity
Working in groups of three or four, choose one of the following project ideas:
- A system to help a university identify students at risk of failing a course.
- A system to help a small restaurant chain forecast daily demand for each menu item.
- A system to help a music streaming service decide which songs to promote.
- A system to help a hospital prioritise which patients to call back for follow-up appointments.
For your chosen project, produce a one-page plan that maps the project onto the eight lifecycle stages. Your plan should specify, for each stage:
- What work would happen.
- Who would need to be involved (technical, domain, or other).
- What the biggest risk is at that stage.
- Roughly how long the stage would take.
Then present your plan to the group, and be prepared to defend your estimates. What parts of the plan are you least confident about?
Homework assignment
Assignment
Write a 1,500-word project proposal for a machine learning system of your choosing. The proposal should be addressed to a hypothetical decision-maker who has the authority to approve or reject the project.
Your proposal must cover:
- The problem and why it matters.
- What the model will predict, and what decision it will inform.
- What data exists (or needs to be collected), and what the sources are.
- What the biggest risks are, framed in terms of the seven failure modes from T-07.
- How the project will be structured across the eight lifecycle stages.
- How success will be measured, and what the criteria for discontinuing the project would be.
- What the ethical implications of the project are, and how they would be addressed.
The proposal should be written for a non-technical audience. Avoid jargon. Where technical concepts are unavoidable, explain them in plain language.
Mini-project: write a lifecycle playbook
Mini-project
Write a practical playbook for a team that is about to start its first machine learning project. Your playbook should:
- Explain each of the eight lifecycle stages in plain language.
- Give specific questions to ask at each stage.
- Identify the most common mistakes made at each stage and how to avoid them.
- Provide a checklist that a team can use at the start of a project.
- Include a one-page summary that could be printed and stuck on a wall.
Your playbook should be aimed at a software engineering team that has technical skills but no machine learning experience. Write for them, not for a research audience.
Deliver your playbook as a document of 2,000–2,500 words, or as a small website. Include diagrams if they help clarify the process.
11 Summary
Key takeaways from this tutorial
- The lifecycle has eight stages: problem framing, data collection, data preparation, exploratory analysis, feature engineering and model selection, training and evaluation, deployment, and monitoring and maintenance.
- The process is iterative, not linear. Projects loop backward regularly. Discovery of a problem at evaluation or monitoring sends the team back to an earlier stage.
- Most of the work is not modelling. Data preparation and exploratory analysis typically consume 40–60% of project time. Model selection and training together usually take less than 20%.
- The lifecycle is a structured response to the failure modes from T-07. Data leakage, spurious correlation, and distribution shift are all much less likely in projects that follow the process carefully.
- Problem framing is the most underrated stage. Many projects fail not because the model is wrong, but because the model is answering the wrong question.
- Deployment and monitoring are not optional extras. A model that stays in a notebook has no value, and a model that is deployed but not monitored will silently degrade.
- This course is organised around the lifecycle. Module 1 introduces the concepts; Unit 2 covers data fundamentals; Unit 3 covers the Python ecosystem; Modules 2–5 cover modelling techniques; Module 6 covers deployment, ethics, and governance.
12 Further Reading
The following sources expand on the lifecycle and process covered in this tutorial.
-
Google. “MLOps: Continuous delivery and automation
pipelines in machine learning.” Google Cloud Architecture
Center.
A detailed, industry-oriented walkthrough of the deployment and monitoring stages. Longer and more technical than this tutorial, and best read after you have finished the course's own modules on those topics. -
Ng, A. (2018). Machine Learning Yearning.
Self-published (available online).
A short, practical book about the process of building machine learning projects. Written for practitioners, but highly accessible to students. Particularly strong on problem framing and evaluation. -
Amershi, S., et al. (2019). “Software Engineering for
Machine Learning: A Case Study.” Proceedings of ICSE 2019.
A research paper that describes how machine learning development actually happens in practice, based on an investigation at Microsoft. Useful for understanding why the process is often messier than the textbook lifecycle suggests. -
Huyen, C. (2022). Designing Machine Learning
Systems. O'Reilly.
A book-length treatment of the full lifecycle, with detailed guidance on each stage. Particularly strong on deployment, monitoring, and the operational concerns that academic courses usually leave out.
Next up
T-09 closes Unit 1 with a structured review of everything you have covered, a set of self-assessment questions that span the entire unit, and a short quiz to check your understanding. After T-09, Unit 2 shifts from concepts to data — where the lifecycle work that dominates real projects actually happens.