Learning outcomes
After this lesson, you will be able to:
- Compare models in terms of predictive performance and interpretability.
- Justify a model choice using error costs, audit needs, and explanation requirements.
- Distinguish interpretability by design from post-hoc explanations.
- Describe the possible trade-off between predictive quality and model complexity without treating it as a universal law.
- Interpret a Pareto frontier when comparing candidate models.
- Select a model in light of its use context, data limitations, and the consequences of mistakes.
If a complex model makes fewer mistakes but is difficult to audit, while a transparent model performs slightly worse, which one should we choose?
1. Why accuracy is not the only criterion
Imagine a system that estimates whether an industrial pump will fail within the next seven days. Model A classifies 91% of cases correctly; model B reaches 94%. At first glance, B seems preferable. But suppose B is a complex ensemble and an engineer cannot trace why a particular pump received a high-risk score. Model A is a small decision tree whose prediction can be followed through a short sequence of conditions.
Real deployment requires more than an average test score. We need to know which errors occur, whether predictions are stable, whether decisions can be checked, and who is accountable for their consequences. In safety-critical, financial, or rights-affecting settings, explanation and auditability may be deployment requirements rather than optional extras.
Predictive performance describes how well predictions match outcomes on new data. Interpretability describes how accessible the model's logic is to people: which relationships it uses, how its behaviour is structured, and how an output is reached.
2. What exactly are we comparing?
People often use “accuracy” as a generic synonym for quality, although Accuracy is only one metric. For binary classification, inspect the confusion matrix and choose metrics that reflect the cost of different errors.
| Criterion | Question | Possible measures |
|---|---|---|
| Predictive performance | How well does the model work on unseen cases? | Accuracy, Precision, Recall, F1, ROC-AUC, PR-AUC; MAE and RMSE for regression |
| Complexity | How complicated is the model structure? | Number of features, coefficients, nodes and tree levels; number of ensemble components |
| Interpretability | Can a person understand the model's logic? | Readable rules, traceable predictions, understandable feature effects |
| Stability | How much does behaviour change when data changes? | Metric variation, stability of structure and predictions across retraining |
| Auditability | Can the system be checked and documented? | Reproducibility, logs, data and model versions, testable constraints |
| Practical cost | What do errors and operation cost? | Missed failures, false alarms, delays, inspection and maintenance costs |
Accuracy can be misleading when the positive class is rare. If only 1% of pumps fail, a classifier that always predicts “no failure” achieves 99% Accuracy while detecting no failures. Metrics must therefore follow the task.
Recall is the share of actual positive cases detected. Precision is the share of positive predictions that are correct. F1 combines Precision and Recall using their harmonic mean. None of these metrics replaces an analysis of the consequences of errors.
3. Interpretability by design and post-hoc explanations
Some models expose their logic directly through parameters or rules. A linear model, for example, computes a weighted sum of features; a small decision tree applies a sequence of conditions. These are often called interpretable by design.
Other models, such as large ensembles and neural networks, have more complex internal structures. Post-hoc methods—feature importance, local explanations, or surrogate models—can help investigate them. Such explanations do not automatically make the original model transparent.
| Model family | What can be inspected directly | Typical limitation |
|---|---|---|
| Linear / logistic regression | Coefficients and feature-effect direction under a suitable specification | Non-linearity and interactions may require engineered terms; coefficients depend on scale and correlations |
| Small decision tree | Rules along the path from root to leaf | Deep trees become hard to read and may be unstable |
| GAM / EBM | Individual feature-effect functions and, in some models, interactions | Many features and interactions can make the model harder to inspect |
| Random forest / gradient boosting | Aggregate summaries and individual trees, when available | The overall prediction combines many components |
| Neural network | Architecture and parameters can be inspected technically | A human-readable account of an individual prediction rarely follows directly from the weights |
Do not confuse model interpretability with the quality of one explanation. A feature-importance plot does not establish causality. A local explanation may describe behaviour around one case without accurately describing the entire model.
4. The Pareto frontier: when not everything can improve at once
Suppose we compare candidate models on two dimensions: predictive quality and interpretability. Some models are more accurate; others are easier to understand. A set of solutions may exist for which one criterion cannot be improved without making another worse. These solutions form a Pareto frontier.
The Pareto frontier does not select a winner. It helps remove clearly dominated candidates and reveals the meaningful alternatives. We then apply constraints such as minimum Recall, response-time limits, explanation requirements, maintenance budgets, and acceptable risk.
Real projects usually involve more than two criteria: performance, interpretability, cost, latency, stability, and fairness may all matter. A two-axis plot is a simplification, not a complete decision model.
5. Error costs can change the model choice
Consider two types of error in pump-failure prediction:
- False Negative (FN): the model fails to warn about a failure that occurs. This may cause downtime, equipment damage, or a safety hazard.
- False Positive (FP): the model warns about a failure that does not occur. This may trigger unnecessary inspection, expense, or production stoppage.
If FN is much more costly than FP, high Recall may matter more even if false alarms increase. If inspections are expensive, Recall and Precision must be balanced. The classification threshold and response policy should be set with process owners, not chosen solely by maximizing F1.
Cost estimates must be justified by domain knowledge. If consequences cannot be meaningfully expressed in money, use constraints or risk levels. Safety, human rights, and trust should not be mechanically reduced to an arbitrary monetary value.
Interpretability matters when a specialist must review or challenge a recommendation, or explain it to an auditor. But transparency alone does not make a model safe: a readable rule can still be wrong, outdated, or based on biased data.
6. Practical experiment: four models for pump-failure prediction
We will compare four model families on one task. This is a teaching experiment design, not a published benchmark. The figures below are illustrative and are included to practise analysis; a real experiment must replace them with results from a consistent evaluation protocol.
6.1. Experimental setup
The goal is to predict whether a pump will fail within the next seven days. An observation represents a pump during a particular period. Features may include vibration, temperature, pressure, operating hours, and maintenance history. The target records whether a failure occurs within the specified time window.
- Split data into training, validation, and test periods chronologically so future information is not used to predict the past.
- Remove target leakage and features that become available only after a failure.
- Use the same available features and test period for every candidate model.
- Tune hyperparameters using training and validation data only.
- Evaluate on the held-out test set; for rare failures, inspect Precision–Recall and the confusion matrix.
- Repeat evaluation across multiple time windows to assess stability.
6.2. Illustrative results
| Model | Recall | Precision | F1 | Illustrative interpretability | Main trade-off |
|---|---|---|---|---|---|
| Logistic regression | 0.78 | 0.70 | 0.74 | High with a suitable specification | Simple form, but limited flexibility without transformations and interactions |
| Small decision tree | 0.74 | 0.76 | 0.75 | High when shallow | Rules are traceable, but instability and lower performance are possible |
| Random forest | 0.84 | 0.75 | 0.79 | Medium to low at the whole-model level | Captures complex relationships but combines many trees |
| Gradient boosting | 0.87 | 0.78 | 0.82 | Lower without additional analysis tools | Highest illustrative F1, but harder to audit as a whole |
In this example, boosting has the highest F1, but that does not automatically make it the deployment choice. If the minimum acceptable Recall is 0.85, it meets the illustrative constraint while the other candidates do not. If every decision must be explained through a short, readable rule set, another model or an additional review procedure may be necessary.
6.3. How to interpret the results
- Do not compare models evaluated on different test sets or preprocessing rules.
- Do not draw conclusions from a single metric.
- Inspect confidence intervals or metric variation when the data supports such estimates.
- Analyse errors separately for important operating conditions and equipment groups.
- Record which explanations are available to model users and how reliable they are.
7. A practical model-selection matrix
Before deployment, write down the requirements. This matrix does not replace expert judgement, but it makes the grounds for a choice explicit.
| Question | What to record | Example requirement |
|---|---|---|
| What do FN and FP cost? | Consequences of each error type | A missed critical failure is unacceptable; a false alarm requires inspection |
| What minimum quality is required? | Metric, threshold, and test protocol | Recall must exceed an agreed level on a temporal test set |
| Who uses the prediction? | Role, expertise, and ability to challenge it | An engineer can see key factors and source measurements |
| What is needed for an audit? | Versions, logs, data, and explanations | A reproducible prediction and retained model version |
| How is drift monitored? | Post-deployment data and performance monitoring | Regular checks of distributions and errors |
A disciplined selection process looks like this:
- Define the task, users, and consequences of errors.
- Set mandatory constraints for quality, safety, latency, and explanation.
- Train several reasonable candidates on the same data.
- Exclude candidates that violate mandatory requirements or are dominated by alternatives.
- Compare the remaining models on the Pareto frontier and test realistic use scenarios.
- Document the choice, limitations, monitoring, and conditions for reconsideration.
8. Limitations and common reasoning mistakes
- “A more complex model is always more accurate.” No. It may overfit, fail to generalize, or perform poorly with limited data.
- “A simple model is always easy to understand.” Not necessarily. A large linear model with many interactions or a deep tree can be difficult to inspect.
- “High Accuracy means reliability.” No, especially with class imbalance and costly rare-event misses.
- “A post-hoc explanation proves why the model decided.” It describes a selected aspect of model behaviour and depends on the method, data, and assumptions.
- “An interpretable model is automatically trustworthy.” Readability does not guarantee correctness, fairness, stability, or safety.
- “There is one best model for every task.” The choice depends on constraints, users, and the consequences of errors.
9. Lesson summary
- Predictive performance and interpretability answer different questions and should be assessed separately.
- A trade-off is possible, but it is not an inevitable law.
- The Pareto frontier removes dominated candidates; it does not choose a winner for us.
- FN and FP costs, audit requirements, and user roles change the selection criteria.
- Post-hoc explanations are useful but do not make a complex model interpretable by design.
- Responsible selection requires a consistent comparison protocol, stability checks, and documented limitations.
The best model is not necessarily the most accurate or the simplest. It is the model that meets the task's requirements, offers acceptable performance and risk, and can be checked to the level required by its application.
What comes next
In the next lesson, we will study non-linear models with interpretable structures and see how to move beyond simple linear relationships while retaining insight into feature effects.
Open the knowledge map ↗Sources and further reading
- scikit-learn: Model evaluation — Classification metrics, confusion matrices, and model evaluation.
- Christoph Molnar: Interpretable Machine Learning — Interpretable models, post-hoc explanations, and methodological limitations.
- Rudin (2019): Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead — Why inherently interpretable models matter in high-stakes settings.
- Sokolova & Lapalme (2009): A systematic analysis of performance measures for classification tasks — A systematic review of classification metrics.
Lesson glossary
A model's ability to predict target values correctly on new data.
The extent to which a person can understand a model's logic or meaningfully inspect its behaviour.
A situation where one option is no worse on every criterion and strictly better on at least one.
The model predicts an event that did not actually occur.
The model fails to detect an event that actually occurred.
An analysis of an already trained model using an additional explanation method.
Knowledge check
Choose one answer for each question and select “Check answer”. Feedback explains the underlying principle.