Temporal Dependencies in Feature Importance for Time Series Predictions

Clayton Rooke, Jonathan Smith, Kin Kwan Leung, Maksims Volkovs, Saba ZuberiarXiv 2021

Abstract

Time series data introduces two key challenges for explainability methods: firstly, observations of the same feature over subsequent time steps are not independent, and secondly, the same feature can have varying importance to model predictions over time. In this paper, we propose Windowed Feature Importance in Time (WinIT), a feature removal based explainability approach to address these issues. Unlike existing feature removal explanation methods, WinIT explicitly accounts for the temporal dependence between different observations of the same feature in the construction of its importance score. Furthermore, WinIT captures the varying importance of a feature over time, by summarizing its importance over a window of past time steps. We conduct an extensive empirical study on synthetic and real-world data, compare against a wide range of leading explainability methods, and explore the impact of various evaluation strategies. Our results show that WinIT achieves significant gains over existing methods, with more consistent performance across different evaluation metrics. The code for our work is publicly available at https://github.com/layer6ai-labs/WinIT.

Introduction

Machine learning models are increasingly deployed for critical time series tasks, such as predicting patient mortality in ICUs or market shifts in finance. However, explaining these "black box" models remains difficult. Standard saliency methods often fail in the time series domain due to two primary factors:

  1. Temporal Dependence: Observations of a feature over time are highly correlated. Removing a single data point allows the model to infer it from adjacent points, masking its true importance.
  2. Delayed Impact: Critical events may not immediately alter model predictions, creating a "temporal shift" between a feature change and the output change.

Existing methods often treat time steps as independent or fail to capture these delayed dynamics, leading to misleading explanations.

Methodology: WinIT

The proposed framework, Windowed Feature Importance in Time (WinIT), is a feature-removal-based approach designed to address these challenges through three key components.

Generative Counterfactuals

Instead of simple zero-masking, which creates out-of-distribution data, WinIT uses a GRU-based generative model to replace removed features with statistically plausible alternatives based on historical data. This ensures the model remains on the "data manifold."

Calculation of importance for a feature segment using generative counterfactuals.

Isolating Marginal Importance

To determine the importance of a feature $S$ at a specific time $a$, WinIT calculates the difference in model performance over two intervals. This subtraction isolates the specific contribution of time step $a$ while accounting for the dependence of subsequent observations.

Isolating the marginal importance of a single time step through subtraction of windowed scores.

The Windowing Effect

WinIT aggregates importance scores over a forward-looking window rather than a single prediction point. This allows the method to capture features with delayed effects on model predictions.

Evaluation and Results

The researchers evaluated WinIT on synthetic benchmarks (Spike & State, Delayed-Spike) and the real-world MIMIC-III mortality dataset.

Key Findings

  • Delayed Impact Handling: On the "Delayed-Spike" dataset, WinIT achieved an AUPRC of 0.996, significantly outperforming other feature-removal methods like FIT or FO, which collapsed to near-zero performance.
  • Real-World Performance: For the MIMIC-III mortality task, WinIT demonstrated a 44% increase in AUC Drop compared to the previous state-of-the-art, Dynamask, indicating superior identification of critical features.
  • Robustness to Masking: The paper highlights the "masking trap," where traditional metrics can be gamed. WinIT showed consistent performance across various masking strategies (END, STD, and STD-BAL).

Conclusion

WinIT provides a robust framework for time series explainability by explicitly modeling temporal dependencies and delayed impacts. While computationally more intensive than gradient-based methods and sensitive to window size selection, it offers significantly more reliable saliency maps for complex temporal data. Future work will focus on automated window size optimization and identifying higher-level temporal patterns.

Reference: Leung, K. K., Rooke, C., Smith, J., Zuberi, S., & Volkovs, M. (2023). Temporal Dependencies in Feature Importance for Time Series Prediction. ICLR 2023.

Summary updated

BibTeX
@misc{rooke2021temporal,
  author = {Clayton Rooke and Jonathan Smith and Kin Kwan Leung and Maksims Volkovs and Saba Zuberi},
  title = {{Temporal Dependencies in Feature Importance for Time Series Predictions}},
  year = {2021},
  eprint = {2107.14317},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.14317},
}
Figure