live: Local Interpretable (Model-Agnostic) Visual Explanations

Mateusz Staniak, Przemysław Biecek, Przemyslaw BiecekOpenalex Unknown 2018 · DOI · OpenAlex

Abstract

Interpretability of complex machine learning models is a growing concern. This package helps to understand key factors that drive the decision made by complicated predictive model (so called black box model). This is achieved through local approximations that are either based on additive regression like model or CART like model that allows for higher interactions. The methodology is based on Tulio Ribeiro, Singh, Guestrin (2016). More details can be found in Staniak, Biecek (2018).

Introduction

As machine learning models grow in complexity—ranging from deep neural networks to massive random forest ensembles—they increasingly function as "black boxes." While these models offer high predictive accuracy, their internal logic is often opaque to human observers. This lack of transparency poses significant challenges in high-stakes domains such as medicine, finance, and law. The live R package addresses this by implementing a framework for Local Interpretable Model-agnostic Explanations (LIME), bridging the gap between high-performance predictive power and human-understandable reasoning.

Methodology

The core philosophy of the live package is to approximate a complex model's behavior locally. While a global model may involve intricate non-linear interactions, its behavior around a specific data point can often be simplified into a "white box" surrogate model.

The live workflow consists of four primary steps:

  1. Local Sampling: Using sample_locally, a synthetic dataset of observations similar to the point of interest is generated.
  2. Labeling: The original black box model predicts outcomes for this synthetic dataset using the add_predictions function.
  3. Fitting the Explanation: The fit_explanation function trains an interpretable surrogate model on the synthetic data.
  4. Visualization: The surrogate model’s weights or structure are visualized to reveal feature influence.
Key parameters for fitting local explanations, including the choice of surrogate model (white_box) and distance kernel.

As shown in the parameter definitions, users can specify the white_box learner and the kernel used to weight observations based on their proximity to the explained instance, ensuring the explanation remains truly local.

Key Features and Insights

Model Agnosticism

The package is truly model-agnostic. It can explain any predictive model—whether a Support Vector Machine, Gradient Boosted Tree, or custom ensemble—provided it possesses a standard predict interface.

Beyond Linear Approximations

Unlike many LIME implementations that rely solely on linear surrogates, live supports Classification and Regression Trees (CART). This allows the local explanation to capture interactions between features that a simple additive model might miss.

Ecosystem Integration

live is designed to integrate seamlessly with the mlr (Machine Learning in R) and DALEX (Descriptive mAchine Learning EXplanations) ecosystems, facilitating its inclusion in professional data science pipelines.

Results and Model Outputs

The primary output of the explanation process is a fitted object containing the surrogate model, the weights used, and the specific instance being explained.

The structure of the object returned by the fit_explanation function, detailing the components of the local surrogate model.

This object allows for various diagnostic and explanatory visualizations, such as waterfall plots which illustrate the positive or negative contribution of individual features to a specific prediction. Additionally, the local_permutation_importance function allows users to quantify feature significance by measuring how shuffling a feature's values impacts the local model's error.

Conclusion

The live package provides a robust toolkit for demystifying complex models through local approximations. While the approach is sensitive to sampling parameters and can be computationally intensive for very large models, it offers a vital path toward more transparent and accountable machine learning. By transforming black box outputs into visual narratives, it empowers stakeholders to trust and verify automated decisions.

Summary updated

Abstract

Interpretability of complex machine learning models is a growing concern. This package helps to understand key factors that drive the decision made by complicated predictive model (so called black box model). This is achieved through local approximations that are either based on additive regression like model or CART like model that allows for higher interactions. The methodology is based on Tulio Ribeiro, Singh, Guestrin (2016) &lt;<a href="https://doi.org/10.1145%2F2939672.2939778" target="_top">doi:10.1145/2939672.2939778</a>&gt;. More details can be found in Staniak, Biecek (2018) &lt;<a href="https://doi.org/10.32614%2FRJ-2018-072" target="_top">doi:10.32614/RJ-2018-072</a>&gt;.
BibTeX
@inproceedings{staniak2018live,
  author = {Mateusz Staniak and Przemysław Biecek and Przemyslaw Biecek},
  title = {{live: Local Interpretable (Model-Agnostic) Visual Explanations}},
  booktitle = {Openalex Unknown},
  year = {2018},
  doi = {10.32614/cran.package.live},
}
Figure