Explainable Decision Tree

Machine Learning
Introduced by
Breiman, L.; Friedman, J.; Olshen, R. A.; Stone, C. J.
Year
1984 (CART); XAI framing formalized 2010s–2020s
Type
Interpretable supervised learning model
Family
Machine learning

What does it do?

An Explainable Decision Tree is a standard classification or regression tree (CART) grown under an explicit depth or complexity constraint, so that each prediction can be read directly as a chain of if-then conditions.

It is used when stakeholders need to inspect and check the reasoning behind every individual prediction, rather than relying on a separate explanation of a more complex model. Its transparency comes from the tree's structure and depends on keeping that constraint, rather than from an approximation added afterwards.

The intuition behind the method

A decision tree partitions the feature space by asking a sequence of binary questions, such as 'Is age > 45?' or 'Is income below threshold X?', until each partition contains mostly one class or a narrow range of target values. Because the full reasoning path from root to leaf is a plain if-then chain, a shallow tree is self-explanatory by design: anyone can trace why a prediction was made without a separate post-hoc explanation method. The word 'explainable' signals a deliberate depth and complexity constraint that preserves this readability.

History

The CART framework is attributed to Breiman, Friedman, Olshen, and Stone (1984), in the monograph Classification and Regression Trees. Rudin (2019) argued that for high-stakes decisions, inherently interpretable models should be preferred over black-box models paired with post-hoc explanations. The explainability framing of trees is therefore comparatively recent, having been formalised in the 2010s–2020s.

When to use it

Choose an Explainable Decision Tree when each prediction must be traceable to explicit conditions, for example under regulatory or audit requirements, in high-stakes decisions such as loan approvals or medical triage, or in teaching settings where non-specialists must follow the reasoning. It suits tabular data with continuous and categorical features, since it makes no distributional assumptions about the features. Check how your software encodes categorical features, because the encoding changes the rules produced. Do not choose it when predictive accuracy is the main goal and interpretability can be handled by post-hoc tools on a more accurate model, or when the signal depends on many interacting features that a shallow tree cannot represent without losing accuracy.

Limitations and considerations

  • Predictive accuracy is typically lower than ensemble methods (Random Forest, gradient boosting) on complex datasets.
  • Greedy splitting does not guarantee a globally optimal tree, and different random seeds can produce noticeably different structures.
  • Depth constraints imposed for explainability can underfit when the true decision boundary is complex.
  • Sensitive to small changes in training data: a single observation can shift an early split and alter the entire tree structure.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Intrinsically interpretable: the exact if-then path to any prediction is visible in the model itself, so the explanation is not an approximation.
  • No feature scaling or normality assumptions are required. Continuous and categorical features can both be used, although many implementations require categorical features to be numerically encoded, and the encoding affects the rules produced.
  • Inference is cheap: each prediction is a short sequence of threshold comparisons.
  • Rule extraction enables direct integration into rule-based or expert systems.
  • The same algorithm supports both classification and regression tasks.
  • Feature importance based on total impurity reduction is produced as part of the fitted model.

Applications

  • Medical diagnosis and clinical decision support, where the rationale must be auditable.
  • Credit scoring and loan approval under transparency requirements.
  • Educational assessment and student outcome prediction with rules that teachers can read.
  • Fraud detection rule-set generation for manual review workflows.
  • Feature selection and exploratory analysis to identify the most discriminative splits before modelling.

How it works

How it works

1

At each node, every candidate feature and threshold is evaluated by an impurity measure: Gini impurity or information gain for classification, and variance reduction for regression. The split that most reduces impurity is chosen. This greedy criterion is efficient but does not guarantee a globally optimal tree.

Formula
\text{Impurity gain} = I(parent) - \sum_{k} \frac{n_k}{n} I(child_k)
2

The chosen split divides the training data into two child nodes, and each child is split again by the same criterion. This binary recursive process continues until a stopping condition is met, producing a hierarchical tree of decision rules over the feature space.

3

To keep the tree explainable, a maximum depth, a minimum number of samples per leaf, or a cost-complexity pruning parameter (alpha) is set before or after growing the tree. No fixed depth is established as readable in general. The limit should be chosen and checked against validation performance and against the number of rules the audience can follow. Deeper trees can recover accuracy at the cost of transparency.

4

Each root-to-leaf path is a conjunction of conditions that forms an explicit if-then rule. These rules can be exported as plain text, drawn as a flow chart, or passed to a rule-based system, so domain experts or reviewers can audit the model directly.

5

A new observation is routed down the tree by applying each split condition in turn until it reaches a leaf. The leaf's majority class label (classification) or mean target value (regression) is the model's prediction, and the path of conditions is its human-readable justification.

Formula
\hat{y} = \text{majority class (classification) or mean } y \text{ (regression) in leaf}

Common pitfalls

  • Allowing the tree to grow deep in pursuit of accuracy, which removes the readability that motivated the choice.
  • Reporting only training accuracy without cross-validation, although a tree can overfit small datasets.
  • Ignoring class imbalance, which biases leaf-level majority-class predictions toward the majority class.
  • Treating feature importances from a single tree as stable variable rankings without checking them across multiple train/test splits.
  • Confusing an explainable decision tree with post-hoc explanation of a black-box model: the former is transparent by construction, while the latter is an approximation of a model's behaviour.

Frequently asked questions

What depth makes a decision tree 'explainable'?

No single cut-off is established in the sources for this page. Keep the depth limited enough that the rules remain readable for your audience. A binary tree of depth d can have up to 2^d leaves, so rule sets become hard to trace by hand as depth grows. Choose the depth by checking validation performance against how many rules your audience can realistically read.

How does an explainable decision tree differ from a regular decision tree?

They use the same algorithm. The 'explainable' label signals an intentional design choice: depth and complexity are constrained so that the resulting rules remain interpretable. A regular decision tree grown to full depth prioritises accuracy over readability.

Should I use SHAP or LIME on top of an explainable decision tree?

Usually not necessary. For a shallow tree the rule paths are normally sufficient as the explanation, so post-hoc tools add little. Such tools are more useful for black-box models.

When should I prefer Random Forest over an explainable decision tree?

When predictive accuracy is the primary concern and you can accept that interpretability is handled by post-hoc tools such as SHAP values or partial-dependence plots. If a regulator or end user must understand every individual prediction without extra tooling, the explainable tree is the safer choice.

How do I handle class imbalance with a decision tree?

Use class weighting, so that errors on minority-class samples count more during splitting, or resample the training data by oversampling the minority class. Without such adjustment, majority-class leaves tend to dominate and minority-class recall can suffer.

Related methods

Sources

  1. Breiman, L., Friedman, J., Olshen, R. A., & Stone, C. J. (1984). Classification and Regression Trees. Wadsworth & Brooks/Cole.

    ISBN: 978-0-412-04841-8
  2. Rudin, C. (2019). Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence, 1(5), 206–215.

    Open DOI reference