localModel: LIME-Based Explanations with Interpretable Inputs Based on Ceteris Paribus Profiles

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

Abstract: Local explanations of machine learning models describe how features contribute to a single prediction. The localModel package implements an explanation method based on LIME (Local Interpretable Model-agnostic Explanations, see Tulio Ribeiro, Singh, Guestrin (2016) <doi:10.1145/2939672.2939778>) in which interpretable inputs are created based on the local rather than global behavior of each original feature.

Introduction

Understanding the rationale behind individual predictions in complex machine learning models is a critical challenge. While the LIME framework provides a popular solution by fitting interpretable surrogate models locally, it often relies on global feature distributions for discretization. This approach can fail to capture nuances specific to the local neighborhood of a data point. The localModel R package addresses this by deriving interpretable inputs directly from local feature sensitivity.

The localModel package provides LIME-like explanations using local Ceteris Paribus profiles.

Methodology

The localModel pipeline refines the standard LIME approach through a multi-step process focused on locality:

  1. Ceteris Paribus Profiling: The tool generates profiles for a chosen observation, illustrating how predictions change as a single feature varies while others remain fixed.
  2. Local Discretization: These profiles are used to define binary "interpretable features" tailored to the model's behavior around the specific instance.
  3. Neighborhood Simulation: A new dataset of similar observations is sampled around the target point.
  4. Weighting: Simulated points are weighted using a kernel function (e.g., Gaussian), prioritizing observations closer to the original point.
  5. Sparse Surrogate Modeling: A LASSO regression model is fitted to the neighborhood predictions. The LASSO penalty ensures that only the most influential local features are included, maintaining interpretability.
Core parameters for the localModel explanation function, highlighting controls for sampling and kernel weighting.

Implementation and Usage

The package is designed to work seamlessly with DALEX explainers, making it applicable to a wide range of black-box models. In practice, users can apply localModel to datasets like the apartments regression data to identify which factors—such as floor area or construction year—most significantly impact a specific price prediction. The package provides built-in plot() methods to visualize these local contributions as bar charts or point plots, as well as functions to inspect the local discretization of continuous variables.

Discussion and Limitations

By focusing on local sensitivity, localModel provides more faithful explanations than methods using global discretization. However, the quality of these explanations is sensitive to several hyperparameters, including the size of the simulated neighborhood and the choice of kernel function. Additionally, the computational overhead of generating Ceteris Paribus profiles and fitting LASSO models for each explanation should be considered when applying the method at scale.

Summary updated

Abstract

Local explanations of machine learning models describe, how features contributed to a single prediction. This package implements an explanation method based on LIME (Local Interpretable Model-agnostic Explanations, see Tulio Ribeiro, Singh, Guestrin (2016) &lt;<a href="https://doi.org/10.1145%2F2939672.2939778" target="_top">doi:10.1145/2939672.2939778</a>&gt;) in which interpretable inputs are created based on local rather than global behaviour of each original feature.
BibTeX
@inproceedings{biecek2019localmodel,
  author = {Przemysław Biecek and Mateusz Staniak and Przemyslaw Biecek},
  title = {{localModel: LIME-Based Explanations with Interpretable Inputs Based on Ceteris Paribus Profiles}},
  booktitle = {Openalex Unknown},
  year = {2019},
  doi = {10.32614/cran.package.localmodel},
}
Figure