Ethics, bias, and knowing when to stop
Spot common failure modes — biased data, feedback loops, and over-automation — and ask better questions before shipping.
Sign in to track progress on this lesson.
01 — Main lesson
Full walk-through. · 7.7 MB
Spoken script — useful when names or terms sound ambiguous.
Welcome back. This is Lesson 12, the final lesson in the series, and today we are talking about ethics, bias, and knowing when to stop. Last time we walked through the full practical workflow from question to monitored model. Today we step back and ask the harder questions, the ones that do not have a library function you can call.
Here is the core idea to carry with you. A machine learning model does not learn the truth about the world. It learns the patterns in your training data. And your training data is a record of what happened in the past, including all the unfairness, all the shortcuts, and all the blind spots that the past contained. If you feed a model historical hiring decisions, it learns how people were hired, not how they should be hired. If you feed it historical lending decisions, it learns who was approved, not who deserved to be approved. The model is a mirror, and it reflects whatever you hold in front of it.
Let us make this concrete. Imagine you are building a model to predict which loan applicants will default. You gather ten years of historical data from your bank. The model learns the patterns and performs well on your test set. You ship it. Six months later, someone notices that applicants from certain postcodes are being approved at much lower rates. You investigate and discover that your bank has historically approved fewer loans in those postcodes. The model did not invent that pattern. It learned it, reinforced it, and scaled it. The bias was in the data, and the model faithfully reproduced it at speed and volume.
This is the first failure mode to watch for. Models mirror historical data, including unfair patterns. The question is not whether your data is biased. All data is biased in some way. The question is whether you have looked at it carefully enough to understand how, and whether you have checked your model's behaviour across different groups of people before you ship.
Now let us talk about something more subtle. You might think, fine, I will just remove the sensitive attributes. I will not include gender, or ethnicity, or age in my training data. Problem solved. Except it is not. Because other features can act as proxies for those attributes.
A postcode can tell you a lot about someone's background. The school they attended can correlate with social class. The name on their application can encode gender or ethnicity. The distance they live from your office can correlate with race in many cities. Even the time of day they submitted their application can correlate with shift workers, which can correlate with income, which can correlate with all sorts of things.
Here is a real-world example. A company built a model to screen job applicants. They carefully removed gender from the data. But they included the text of each applicant's previous performance reviews. The model learned to penalise reviews that contained the word women's, as in women's chess club or women's networking group. The proxy feature, the review text, smuggled in the sensitive attribute, gender, and the model used it to downgrade female applicants. Removing the obvious column does not remove the information. It just hides it.
So the second failure mode is proxy features. When you review your features, ask yourself, could any of these encode information about a protected characteristic? Could a postcode, a name, a school, a device type, or a writing style be standing in for something you deliberately excluded? You will not catch every proxy, but you should look for the obvious ones and test your model's outputs across groups.
Now let us move to a different kind of failure, one that happens not in the model but in the people around it. It is called automation bias, and it is the tendency for people to over-trust an automated score.
Imagine a doctor using a model that predicts the probability of a serious condition. The model says low risk. The doctor has a nagging feeling something is wrong, but the score says low risk, so they send the patient home. Later it turns out the patient was very ill. The doctor overrode their own judgement in favour of the model's output.
This happens everywhere. A hiring manager sees a low fit score and skips reading the candidate's portfolio. A fraud analyst sees a low fraud score and approves a transaction without looking at it. A support team sees a high churn risk score and treats a customer differently before understanding why the score is high. People tend to treat model outputs as authoritative, even when the model is uncertain, even when the model was trained on imperfect data, even when the model was never designed to make the final call.
The fix is partly about design and partly about culture. In design, always show a confidence score alongside the prediction, and make it meaningful. If the model is only sixty percent confident, that should be visible. In culture, train people to treat the model as one input among several, not as an oracle. The model is a decision support tool, not a decision maker, unless you have deliberately and carefully designed it to be one.
This connects to something from the last lesson. You designed a human-in-the-loop. The question is whether the humans in that loop actually feel empowered to override the model. If they get blamed for overriding it and ignoring its advice, they will stop overriding it. If they get blamed for not overriding it when it was wrong, they will second-guess everything. You need to make the override path normal, expected, and safe.
Now let us talk about privacy. Training data can leak in ways you might not expect. If you train a language model on internal documents, it can sometimes reproduce passages from those documents when prompted in the right way. If you train a model on customer data, someone might be able to query the model and extract information about specific individuals. If you collect more data than you need, you are holding risk you do not need to hold.
The principles are simple, even if the implementation is not. Minimise what you collect. If you do not need a field for the model to work, do not collect it. Protect what you store, with access controls, encryption, and audit trails. Be careful about what you log. Model inputs and outputs are often logged for monitoring, and those logs can contain sensitive personal data. Think about retention. How long do you need to keep the training data? Can you anonymise or aggregate it? Can you delete it after a defined period?
Privacy is not just a legal obligation, though it is that. It is a matter of trust. If people learn that you used their data in ways they did not expect, they will lose trust in your system, and rightly so.
Now, the heart of this lesson is not a list of failure modes. It is a set of questions you should bring to every project, every design review, every conversation about whether to ship. Let me give you the three that matter most.
First, who is harmed by errors? Every model makes mistakes. A false positive and a false negative are not symmetric in their consequences. If your spam filter wrongly classifies a legitimate email as spam, someone misses a message. Annoying but recoverable. If your medical model wrongly classifies a sick patient as healthy, someone might not get treatment. Not recoverable. Before you ship, map out the error types and ask, for each one, who is affected and how badly. Then ask whether the people affected are the same people who benefit from the system. Often the people who bear the cost of errors are not the people who gain from the automation. That asymmetry matters.
Second, who is left out of the data? Your training data represents the people who were in the system. What about the people who were not? If your hiring model was trained on past employees, it reflects the population that was hired. It says nothing about people who never applied, or who applied and were filtered out before reaching the stage your data captures. If your healthcare model was trained on patients who visited a clinic, it says nothing about people who could not afford to visit. Underrepresentation in data leads to worse predictions for those groups, and those groups are often the ones who can least afford to be on the wrong end of a bad prediction.
Third, can you explain a decision? If your model denies someone a loan, rejects their job application, or flags them as a fraud risk, can you tell them why? Some models are more explainable than others. A simple decision tree is easy to explain. A deep neural network is not. But even with a complex model, you can use techniques to approximate explanations, or you can design your system so that a human reviews borderline cases and can articulate a reason. The question is not whether your model is perfectly interpretable. The question is whether, when someone asks why a decision was made about them, you have a better answer than the computer said so.
These three questions, who is harmed by errors, who is left out of the data, and can we explain a decision, should be part of every design review. If you cannot answer them, you are not ready to ship.
Now, before we close, let me recap the whole series. We have walked a long way together.
In Lesson 1, we started with what machine learning actually is, learning patterns from data rather than writing explicit rules. In Lesson 2, we covered supervised learning, the most common type, where you learn from labelled examples. In Lesson 3, we looked at unsupervised learning, finding structure in unlabelled data. In Lesson 4, we talked about training, validation, and test sets, and why you must never evaluate on your training data. In Lesson 5, we covered the bias-varariance trade-off, the balance between underfitting and overfitting. In Lesson 6, we looked at linear models, the simplest and often most useful starting point. In Lesson 7, we explored tree-based models and ensembles, which combine many simple models for stronger predictions. In Lesson 8, we covered neural networks, the flexible function approximators behind modern deep learning. In Lesson 9, we talked about evaluation metrics, accuracy, precision, recall, and why accuracy alone is misleading. In Lesson 10, we looked at cross-validation and choosing the right metric for the real-world cost of errors. In Lesson 11, we walked through the full practical workflow from question to monitored model. And today, in Lesson 12, we have covered ethics, bias, and the questions you should ask before shipping.
That is the arc. You now have the vocabulary, the mental models, and the practical framework to start building machine learning systems that actually work and that you can defend. You do not need to know everything. You need to know enough to ask good questions, recognise common failure modes, and know when to slow down.
And that brings me to the final idea of this course. Knowing when to stop. The hardest judgement in machine learning is not when to train a model. It is when not to. When the data is too biased. When the stakes are too high for the accuracy you can achieve. When the decision cannot be explained. When the people affected have no way to appeal. When the cost of a wrong decision falls on someone who did not choose to be part of your system. In those cases, the right answer might be a simpler model, a human decision, a different process entirely, or no model at all.
That is not a failure. That is good engineering. The goal was never to use machine learning. The goal was to make better decisions. Sometimes machine learning helps. Sometimes it does not. Knowing the difference is the most important skill you can develop.
As you finish your walk, let me leave you with three questions to carry into any machine learning design review, written on a card, stuck on a wall, asked out loud in every meeting. Who is harmed by errors? Who is left out of the data? Can we explain a decision? If you ask those three questions every time, you will build better systems, catch problems earlier, and earn the trust of the people your systems affect.
That is the end of the course. Thank you for walking through it with me. You have done the work. Go and build something useful, something fair, and something you are willing to stand behind. Enjoy the rest of your walk.
Here is the core idea to carry with you. A machine learning model does not learn the truth about the world. It learns the patterns in your training data. And your training data is a record of what happened in the past, including all the unfairness, all the shortcuts, and all the blind spots that the past contained. If you feed a model historical hiring decisions, it learns how people were hired, not how they should be hired. If you feed it historical lending decisions, it learns who was approved, not who deserved to be approved. The model is a mirror, and it reflects whatever you hold in front of it.
Let us make this concrete. Imagine you are building a model to predict which loan applicants will default. You gather ten years of historical data from your bank. The model learns the patterns and performs well on your test set. You ship it. Six months later, someone notices that applicants from certain postcodes are being approved at much lower rates. You investigate and discover that your bank has historically approved fewer loans in those postcodes. The model did not invent that pattern. It learned it, reinforced it, and scaled it. The bias was in the data, and the model faithfully reproduced it at speed and volume.
This is the first failure mode to watch for. Models mirror historical data, including unfair patterns. The question is not whether your data is biased. All data is biased in some way. The question is whether you have looked at it carefully enough to understand how, and whether you have checked your model's behaviour across different groups of people before you ship.
Now let us talk about something more subtle. You might think, fine, I will just remove the sensitive attributes. I will not include gender, or ethnicity, or age in my training data. Problem solved. Except it is not. Because other features can act as proxies for those attributes.
A postcode can tell you a lot about someone's background. The school they attended can correlate with social class. The name on their application can encode gender or ethnicity. The distance they live from your office can correlate with race in many cities. Even the time of day they submitted their application can correlate with shift workers, which can correlate with income, which can correlate with all sorts of things.
Here is a real-world example. A company built a model to screen job applicants. They carefully removed gender from the data. But they included the text of each applicant's previous performance reviews. The model learned to penalise reviews that contained the word women's, as in women's chess club or women's networking group. The proxy feature, the review text, smuggled in the sensitive attribute, gender, and the model used it to downgrade female applicants. Removing the obvious column does not remove the information. It just hides it.
So the second failure mode is proxy features. When you review your features, ask yourself, could any of these encode information about a protected characteristic? Could a postcode, a name, a school, a device type, or a writing style be standing in for something you deliberately excluded? You will not catch every proxy, but you should look for the obvious ones and test your model's outputs across groups.
Now let us move to a different kind of failure, one that happens not in the model but in the people around it. It is called automation bias, and it is the tendency for people to over-trust an automated score.
Imagine a doctor using a model that predicts the probability of a serious condition. The model says low risk. The doctor has a nagging feeling something is wrong, but the score says low risk, so they send the patient home. Later it turns out the patient was very ill. The doctor overrode their own judgement in favour of the model's output.
This happens everywhere. A hiring manager sees a low fit score and skips reading the candidate's portfolio. A fraud analyst sees a low fraud score and approves a transaction without looking at it. A support team sees a high churn risk score and treats a customer differently before understanding why the score is high. People tend to treat model outputs as authoritative, even when the model is uncertain, even when the model was trained on imperfect data, even when the model was never designed to make the final call.
The fix is partly about design and partly about culture. In design, always show a confidence score alongside the prediction, and make it meaningful. If the model is only sixty percent confident, that should be visible. In culture, train people to treat the model as one input among several, not as an oracle. The model is a decision support tool, not a decision maker, unless you have deliberately and carefully designed it to be one.
This connects to something from the last lesson. You designed a human-in-the-loop. The question is whether the humans in that loop actually feel empowered to override the model. If they get blamed for overriding it and ignoring its advice, they will stop overriding it. If they get blamed for not overriding it when it was wrong, they will second-guess everything. You need to make the override path normal, expected, and safe.
Now let us talk about privacy. Training data can leak in ways you might not expect. If you train a language model on internal documents, it can sometimes reproduce passages from those documents when prompted in the right way. If you train a model on customer data, someone might be able to query the model and extract information about specific individuals. If you collect more data than you need, you are holding risk you do not need to hold.
The principles are simple, even if the implementation is not. Minimise what you collect. If you do not need a field for the model to work, do not collect it. Protect what you store, with access controls, encryption, and audit trails. Be careful about what you log. Model inputs and outputs are often logged for monitoring, and those logs can contain sensitive personal data. Think about retention. How long do you need to keep the training data? Can you anonymise or aggregate it? Can you delete it after a defined period?
Privacy is not just a legal obligation, though it is that. It is a matter of trust. If people learn that you used their data in ways they did not expect, they will lose trust in your system, and rightly so.
Now, the heart of this lesson is not a list of failure modes. It is a set of questions you should bring to every project, every design review, every conversation about whether to ship. Let me give you the three that matter most.
First, who is harmed by errors? Every model makes mistakes. A false positive and a false negative are not symmetric in their consequences. If your spam filter wrongly classifies a legitimate email as spam, someone misses a message. Annoying but recoverable. If your medical model wrongly classifies a sick patient as healthy, someone might not get treatment. Not recoverable. Before you ship, map out the error types and ask, for each one, who is affected and how badly. Then ask whether the people affected are the same people who benefit from the system. Often the people who bear the cost of errors are not the people who gain from the automation. That asymmetry matters.
Second, who is left out of the data? Your training data represents the people who were in the system. What about the people who were not? If your hiring model was trained on past employees, it reflects the population that was hired. It says nothing about people who never applied, or who applied and were filtered out before reaching the stage your data captures. If your healthcare model was trained on patients who visited a clinic, it says nothing about people who could not afford to visit. Underrepresentation in data leads to worse predictions for those groups, and those groups are often the ones who can least afford to be on the wrong end of a bad prediction.
Third, can you explain a decision? If your model denies someone a loan, rejects their job application, or flags them as a fraud risk, can you tell them why? Some models are more explainable than others. A simple decision tree is easy to explain. A deep neural network is not. But even with a complex model, you can use techniques to approximate explanations, or you can design your system so that a human reviews borderline cases and can articulate a reason. The question is not whether your model is perfectly interpretable. The question is whether, when someone asks why a decision was made about them, you have a better answer than the computer said so.
These three questions, who is harmed by errors, who is left out of the data, and can we explain a decision, should be part of every design review. If you cannot answer them, you are not ready to ship.
Now, before we close, let me recap the whole series. We have walked a long way together.
In Lesson 1, we started with what machine learning actually is, learning patterns from data rather than writing explicit rules. In Lesson 2, we covered supervised learning, the most common type, where you learn from labelled examples. In Lesson 3, we looked at unsupervised learning, finding structure in unlabelled data. In Lesson 4, we talked about training, validation, and test sets, and why you must never evaluate on your training data. In Lesson 5, we covered the bias-varariance trade-off, the balance between underfitting and overfitting. In Lesson 6, we looked at linear models, the simplest and often most useful starting point. In Lesson 7, we explored tree-based models and ensembles, which combine many simple models for stronger predictions. In Lesson 8, we covered neural networks, the flexible function approximators behind modern deep learning. In Lesson 9, we talked about evaluation metrics, accuracy, precision, recall, and why accuracy alone is misleading. In Lesson 10, we looked at cross-validation and choosing the right metric for the real-world cost of errors. In Lesson 11, we walked through the full practical workflow from question to monitored model. And today, in Lesson 12, we have covered ethics, bias, and the questions you should ask before shipping.
That is the arc. You now have the vocabulary, the mental models, and the practical framework to start building machine learning systems that actually work and that you can defend. You do not need to know everything. You need to know enough to ask good questions, recognise common failure modes, and know when to slow down.
And that brings me to the final idea of this course. Knowing when to stop. The hardest judgement in machine learning is not when to train a model. It is when not to. When the data is too biased. When the stakes are too high for the accuracy you can achieve. When the decision cannot be explained. When the people affected have no way to appeal. When the cost of a wrong decision falls on someone who did not choose to be part of your system. In those cases, the right answer might be a simpler model, a human decision, a different process entirely, or no model at all.
That is not a failure. That is good engineering. The goal was never to use machine learning. The goal was to make better decisions. Sometimes machine learning helps. Sometimes it does not. Knowing the difference is the most important skill you can develop.
As you finish your walk, let me leave you with three questions to carry into any machine learning design review, written on a card, stuck on a wall, asked out loud in every meeting. Who is harmed by errors? Who is left out of the data? Can we explain a decision? If you ask those three questions every time, you will build better systems, catch problems earlier, and earn the trust of the people your systems affect.
That is the end of the course. Thank you for walking through it with me. You have done the work. Go and build something useful, something fair, and something you are willing to stand behind. Enjoy the rest of your walk.
02 — Refresh
Short recap. · 1.0 MB
Spoken script — useful when names or terms sound ambiguous.
Here is a quick recap of what we covered today. A machine learning model learns patterns from your training data, and that data carries all the unfairness and blind spots of the past. The model does not invent bias, it reproduces it, often faster and at greater scale than a human ever could.
Removing sensitive attributes like gender or ethnicity is not enough, because other features can act as proxies. A postcode, a school name, or the text of a performance review can smuggle in the very information you tried to exclude. Always look for proxies when reviewing your features.
Automation bias is the tendency for people to over-trust a model's score, even when their own judgement says otherwise. Show confidence scores, train people to treat the model as one input among several, and make the override path safe and normal.
Protect privacy by minimising what you collect, securing what you store, and being careful about what your logs capture. Training data can leak through model outputs in ways you might not expect.
The three questions to ask in any design review are these. Who is harmed by errors? Who is left out of the data? Can we explain a decision? If you cannot answer those, you are not ready to ship.
And finally, knowing when not to deploy a model is itself a skill. The goal is better decisions, not machine learning for its own sake. Sometimes the right answer is a simpler approach or no model at all. That is good engineering, not failure. That closes the course. Thank you for walking through all twelve lessons. Go build something you can stand behind.
Removing sensitive attributes like gender or ethnicity is not enough, because other features can act as proxies. A postcode, a school name, or the text of a performance review can smuggle in the very information you tried to exclude. Always look for proxies when reviewing your features.
Automation bias is the tendency for people to over-trust a model's score, even when their own judgement says otherwise. Show confidence scores, train people to treat the model as one input among several, and make the override path safe and normal.
Protect privacy by minimising what you collect, securing what you store, and being careful about what your logs capture. Training data can leak through model outputs in ways you might not expect.
The three questions to ask in any design review are these. Who is harmed by errors? Who is left out of the data? Can we explain a decision? If you cannot answer those, you are not ready to ship.
And finally, knowing when not to deploy a model is itself a skill. The goal is better decisions, not machine learning for its own sake. Sometimes the right answer is a simpler approach or no model at all. That is good engineering, not failure. That closes the course. Thank you for walking through all twelve lessons. Go build something you can stand behind.