Landscape of R packages for eXplainable Artificial Intelligence

Szymon Maksymiuk, Alicja Gosiewska, Przemyslaw BiecekarXiv 2020 · arXiv

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).

Figure 1: Decision flowchart for selecting XAI methods based on model transparency and explanation needs.

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.

Figure 4: Capability matrix of R and Python XAI packages across the explanation-oriented taxonomy.

Key findings from the benchmarking include:

  • Versatility Leaders: DALEX (and its extension DALEXtra) and flashlight emerged 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 iml package was significantly faster (0.33s) compared to DALEX (10.23s) and flashlight (7.11s).
  • Framework Support: The caret package is supported by the highest number of XAI tools, while newer frameworks like mlr3 still 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

Abstract

The growing availability of data and computing power fuels the development of predictive models. In order to ensure the safe and effective functioning of such models, we need methods for exploration, debugging, and validation. New methods and tools for this purpose are being developed within the eXplainable Artificial Intelligence (XAI) subdomain of machine learning. In this work (1) we present the taxonomy of methods for model explanations, (2) we identify and compare 27 packages available in R to perform XAI analysis, (3) we present an example of an application of particular packages, (4) we acknowledge recent trends in XAI. The article is primarily devoted to the tools available in R, but since it is easy to integrate the Python code, we will also show examples for the most popular libraries from Python.
BibTeX
@misc{maksymiuk2020landscape,
  author = {Szymon Maksymiuk and Alicja Gosiewska and Przemyslaw Biecek},
  title = {{Landscape of R packages for eXplainable Artificial Intelligence}},
  year = {2020},
  eprint = {2009.13248},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2009.13248},
}
Figure