e2tree distils any ensemble of decision trees into a single, interpretable tree — preserving predictive accuracy while delivering transparent, human-readable decision rules. Supports classification and regression with any tree-based ensemble.
Ensemble methods based on decision trees routinely outperform single decision trees, but at the cost of interpretability: hundreds of learners whose joint reasoning is opaque to practitioners and regulators alike.
e2tree resolves this by deriving a co-occurrence matrix from the ensemble — how often any two observations share a terminal node across all trees — then using that dissimilarity structure to grow a single tree that summarises the ensemble's behaviour.
The result is a concise decision tree whose split rules, variable importances, and local interpretations faithfully reproduce what the ensemble learned — with no drop in predictive performance.
The framework supports both classification and regression tasks, integrates with randomForest and ranger, and is fully open-source on CRAN under the MIT license.
Case study: Heart Disease Risk Stratification — the e2tree distils 500 ensemble trees into six clear, auditable decision rules a cardiologist can act on.
Press Distil → then hover any leaf node to read the full decision path. The panel below will explain each rule in clinical terms.
Each function maps to one step. Every intermediate object is inspectable and exportable.
Full documentationUse randomForest() or ranger(). Any standard training configuration works.
createDisMatrix() derives a co-occurrence matrix O from the ensemble's terminal node structure. Each entry oij ∈ [0,1] measures how often observations i and j share a leaf across all trees. The dissimilarity is D = 1 − O.
e2tree() grows the single tree guided by the dissimilarity structure. Depth, impurity threshold, and node size are controlled via the setting list.
Standard S3 methods — print(), summary(), plot() — provide a compact overview, detailed decision rules, and visual rendering via rpart.plot or partykit.
predict() routes new observations through the split rules. eValidation() checks how closely the tree matches the ensemble's proximity structure.
vimp() computes variable importance from the tree's split structure. loi() provides observation-level local importance with optional permutation-based significance testing.
Five steps from raw data to an interpretable tree. Install from CRAN and run it today.
Works for both classification (factor response) and regression (continuous response). The workflow is the same in both cases.
eValidation() measures how closely the e2tree matches the ensemble's proximity structure. It returns concordance metrics and a proximity heatmap.
vimp() provides global variable importance from the tree structure. loi() adds observation-level importance with optional permutation-based significance testing.
e2tree objects convert to rpart format (for rpart.plot) or to partykit's constparty format. Both give access to the standard R tree visualization tools.
Two peer-reviewed papers describe the method — one for classification, one for regression.
Aria, M., Gnasso, A., Iorio, C., & Pandolfo, G. (2024). Explainable ensemble trees. Computational Statistics, 39(1), 3–19. doi:10.1007/s00180-022-01312-6 ↗
Aria, M., Gnasso, A., Iorio, C., & Fokkema, M. (2026). Extending Explainable Ensemble Trees to Regression Contexts. Applied Stochastic Models in Business and Industry, 42(1), e70064. doi:10.1002/asmb.70064 ↗