Machine learning model interpretability, part 1: opening the black box
Why the most accurate models are often the least interpretable, why it pays to understand them and what makes a good explanation.
Machine learning and deep learning models find patterns without prior assumptions, but the most accurate ones often work as black boxes. This first part explains what interpretability is, why it matters for a model’s safety, bias detection, acceptance and auditing, and which properties a good explanation should have.
TABLA DE CONTENIDOS
Series «Machine learning model interpretability», part 1 of 2. Part 1 · Part 2
Machine learning model interpretability is the ability to understand why a machine learning model makes a given decision. This article, the first of two, explains why the most accurate models tend to be black boxes, why it pays to open them up (safety, bias, acceptance and auditing) and what properties a good explanation should have.
You do not really understand something unless you can explain it to your grandmother.
(Attributed to Einstein; there is no concrete evidence he said it)
Interpretability is the degree to which a human can understand the cause of a decision.
(Miller, Tim. “Explanation in artificial intelligence: Insights from the social sciences”, 2017)
When we start analyzing data with machine learning (ML) methods, we work with models or algorithms that automatically learn patterns from data and then use them to make predictions or other decisions under uncertainty about future data.
Why use machine learning and deep learning?
Classical data analysis methods that support decisions about the future belong to the field of statistical inference. The starting point is choosing a model that assumes a certain behavior in the data, whose parameters must be estimated to approximate how the data actually behave.
This is where the automatic part of learning in machine learning (ML) and deep learning (DL) comes in: with these models you do not need to make assumptions about the patterns in the data. Instead, the computing power of the models approximates them for you, uncovering relationships that may be unknown and invisible to the human eye.
Who does the data analysis?
Automating learning does not mean automating the whole analytical task. Even without distributional assumptions, the analyst still needs to know the data to decide how the model should best learn.
The second part of the task is choosing the machine learning model best suited to the problem at hand and to the architecture of the data.
So the next problem is how to choose the best machine learning model. A common approach is to choose by performance, that is, the model that best fits the data, and the first candidates are usually complex models with little or no interpretability, which is why they are called black-box models.
What is machine learning model interpretability?
Interpretability is the degree to which a human can consistently predict the model’s result.
(Kim, Been, Rajiv Khanna and Oluwasanmi O. Koyejo. “Examples are not enough, learn to criticize! Criticism for interpretability.” Advances in Neural Information Processing Systems, 2016)
Understanding what you are doing is a necessary step toward improving it. As ML moved away from classical statistical inference algorithms, such as linear regression, toward more complex models, such as neural networks, people started talking about black-box models.
As data scientists we could see the data the model learned from to predict the future (input), the predictions it made (output) and how accurate they were (performance), but what the model learned from the data was a black box, something we could not interpret.
Even if we know how the model learns or works, we cannot process in our heads what it does inside that box just by following the steps of the algorithm.
That is why we need mechanisms to understand these models and get inside the black box to see how the model achieves good results. That is what ML model interpretability means.
Why study machine learning model interpretability?
Some of the reasons to explore and improve the interpretability of machine learning models:
- Safety and testing: understanding how the model works can help prevent or anticipate potential causes of failure.
- Detecting and fixing bias in AI models, so the model does not discriminate based on demographic characteristics that would make it socially unacceptable.
- Social acceptance: an approximate explanation of the model’s results makes human users more willing to accept it.
- ML models can only be refined and audited when we can understand their results and how they work.
The main goal of studying machine learning model interpretability is to produce a good explanation of the model’s results.
What makes a good explanation?
When we talk about explaining a model, we need to keep in mind what the explanation is for: different uses of a model create different requirements.
Understanding a model to audit it is not the same as presenting it to a client, and a scoring model where the end user only gets a purchase propensity is not the same as a disease prediction model that can drive decisions about our health. With sensitive topics, you need more certainty about what you report.
To that end, we can define desirable properties for an explanation, with specific thresholds agreed with the data owners:
- Accuracy. How well does an explanation predict unseen real data? This matters most when you work with a predictive ML model and the goal is to explain the real problem.
- Fidelity. How well does an explanation approximate the ML model’s predictions? High fidelity is what makes the explanation useful for explaining the model. Some methods only achieve it locally: for a subset of observations (LIME) or for individual points (Shapley values).
- Stability. When comparing explanations for similar instances of a fixed model, small changes in an observation’s variables should not substantially change the explanation, unless those changes affect the model’s predictions.
- Comprehensibility. How well do humans understand the explanation? How hard it is to measure and achieve this property is a key issue in interpretability research.
- Certainty or confidence. Does the explanation reflect how confident the model’s predictions are? The explanation should make clear how certain the results are.
- Degree of importance. How well does the explanation reflect the relative importance of each component or variable it uses? This matters for building or evaluating decision rules from the explanation.
- Representativeness. How many instances or observations does the explanation cover?
How to improve a machine learning model’s interpretability
There are several approaches to interpreting ML models. The table below summarizes some of them and their characteristics:

The next article introduces the theory behind five of these methods (PDP, ICE, feature importance, LIME and Shapley values) and some guidelines for using them to make your models more interpretable.
Camila Palomeque
Consultant, Data & Analytics unit