Incremental permutation feature importance (iPFI): towards online explanations on data streams

Fabian Fumagalli, Maximilian Muschalik, Eyke Hüllermeier, Barbara Hammer · DOI

Abstract

Modern machine learning applications increasingly rely on data streams where patterns evolve over time, a phenomenon known as concept drift. While Explainable AI (XAI) has matured for static datasets, explaining streaming models remains a challenge due to computational constraints and the need for temporal relevance. This paper introduces iPFI, the first mathematically substantiated method for calculating global feature importance incrementally. By integrating exponential smoothing with novel reservoir sampling strategies, iPFI provides real-time, model-agnostic explanations that adapt to drift with linear time and constant memory complexity.

Introduction

Most XAI techniques are designed for static scenarios with fixed datasets. However, in domains like energy grid monitoring or fraud detection, data arrives continuously. Traditional Permutation Feature Importance (PFI) measures model reliance on specific features but fails in streaming settings due to two major flaws: computational cost and "staleness." Batch-based explanations cannot react to changes in the model or the data distribution as they happen.

Overview of anytime explanations using iPFI on a data stream.

The authors propose iPFI to provide "anytime" estimates that are memory-efficient and capable of "forgetting" outdated patterns to reflect the current state of a drifting model.

Methodology

The iPFI algorithm moves away from batch calculations through two primary mechanisms:

  1. Exponential Smoothing: Importance estimates are updated at every time step using a smoothing parameter ($\alpha$), allowing the explanation to evolve dynamically as new data arrives.
  2. Incremental Sampling Strategies: To marginalize features on the fly (replacing values to observe model reaction), the authors propose:
  3. Uniform Sampling: Uses a standard reservoir for equal-probability sampling of past observations.
  4. Geometric Sampling: A novel approach where newer observations have a higher probability of retention. This ensures the explanation reflects the current data manifold rather than an outdated one during concept drift.

Crucially, the authors introduce a $N/(N-1)$ scaling factor to correct biases found in standard PFI implementations, proving that iPFI is an unbiased estimator with theoretical guarantees on approximation quality.

Experimental Setup

iPFI was validated across various benchmarks:

  • Static Benchmarks: adult (census), bank (marketing), and bike (regression).
  • Real-world Streams: elec2 (electricity pricing), ozone (weather), and insects (mosquito flight data).
  • Synthetic Drift Benchmarks: agrawal and stagger generators were used to induce function and feature drift, testing the speed of adaptation.

The algorithm was tested on diverse models, including Adaptive Random Forests (ARF), Hoeffding Adaptive Trees (HAT), and Neural Networks (NN).

Results and Discussion

Experimental results highlight several key strengths of iPFI:

  • Rapid Adaptation: In synthetic drift scenarios, iPFI detected shifts in feature importance almost instantly, significantly outperforming traditional interval-based methods which exhibited lag and uncertainty.
  • High Fidelity: In static settings, iPFI's results closely matched "gold standard" batch PFI, with median errors as low as 0.011 on the agrawal dataset.
  • Efficiency: The overhead scales linearly with the number of features ($|D|$). In practice, 95% to 99% of computation time is dedicated to model inference, making the explanation overhead remarkably low.

Conclusion

iPFI addresses a critical gap in streaming XAI by providing a mathematically sound, adaptive, and efficient global importance measure. While the choice of the smoothing parameter $\alpha$ remains a trade-off between noise and responsiveness, the introduction of geometric sampling provides a robust solution for handling concept drift. Future work may explore human perception of these explanation streams and extend incremental approaches to more complex measures like Shapley values.

Summary updated

BibTeX
@article{fumagalli2023incremental,
  author = {Fabian Fumagalli and Maximilian Muschalik and Eyke Hüllermeier and Barbara Hammer},
  title = {{Incremental permutation feature importance (iPFI): towards online explanations on data streams}},
  journal = {Machine Learning},
  year = {2023},
  doi = {10.1007/s10994-023-06385-y},
}
Figure