Abstract
The rapid adoption of complex "black-box" machine learning models has created a significant interpretability gap, where high predictive accuracy comes at the cost of transparency. This paper presents a comprehensive survey of the R ecosystem for eXplainable AI (XAI), identifying and evaluating 27 distinct packages. By introducing a dual taxonomy—categorizing methods by both model type and explanation scope—the authors provide a structured framework for practitioners. Through benchmarking on the Titanic dataset, the study highlights leaders in versatility and performance, offering a practical roadmap for navigating the fragmented landscape of modern interpretability tools.
Introduction
As machine learning architectures evolve toward deep neural networks and gradient-boosted trees, the challenge of model validation grows. While these models excel at capturing non-linear patterns, their internal logic remains opaque, leading to potential issues with fairness, hidden biases, and stakeholder trust. This "interpretability gap" necessitates tools that can debug and explain model behavior. However, the R ecosystem for XAI is highly fragmented, leaving data scientists uncertain about which package best suits their needs—whether they require a global overview of feature behavior or a local explanation for a single prediction.
Methodology: A Dual Taxonomy
The authors organize the XAI landscape using two primary lenses: a model-oriented taxonomy and an explanation-oriented taxonomy. The model-oriented view distinguishes between models that are interpretable by design (e.g., linear models), model-specific tools (e.g., for XGBoost), and model-agnostic methods that apply to any architecture. The explanation-oriented view separates Global explanations (dataset-level trends) from Local explanations (individual predictions), further subdivided into "Parts" (variable importance), "Profiles" (functional effects), and "Diagnostics" (error analysis).
To ensure a fair "apples-to-apples" comparison, the authors selected 27 R packages based on CRAN popularity (>5,000 downloads) and XAI-specific keywords. These tools were evaluated using the Titanic dataset as a consistent benchmark, assessing functionality, interoperability with popular ML frameworks (like caret and mlr3), and computational performance.
Key Insights and Results
The study reveals that interoperability is a spectrum rather than a binary state. While many packages claim to be model-agnostic, the effort required to integrate them varies significantly, often necessitating custom wrappers. A historical shift is also noted: while older tools focused on global profiles (e.g., Partial Dependence Plots), newer developments prioritize local explanations (e.g., Shapley values, LIME) and model fairness.
Key findings from the benchmarking include:
- Versatility Leaders:
DALEX(and its extensionDALEXtra) andflashlightemerged as the most comprehensive packages, supporting nearly all types of global and local explanations. - Performance Variance: In a head-to-head test for calculating Shapley values, the
imlpackage was significantly faster (0.33s) compared toDALEX(10.23s) andflashlight(7.11s). - Framework Support: The
caretpackage is supported by the highest number of XAI tools, while newer frameworks likemlr3still have fewer direct integrations.
Conclusion
The XAI field is moving incredibly fast; several promising packages (like shapr and treeshap) were only just emerging during the study. While this review provides a robust map of the current R landscape, future work is needed to address high-dimensional data and specialized domains such as computer vision and natural language processing. For now, this taxonomy and the accompanying "Gallery" of standardized reports serve as an essential resource for data scientists seeking to make their models more transparent and trustworthy.
Summary updated