Interpreting Time Series Forecasts with LIME and SHAP: A Case Study on the Air Passengers Dataset
Manish A. Shukla · 2025
Read Interpreting Time Series Forecasts with LIME and SHAP: A Case Study on the Air Passengers Dataset by Manish A. Shukla (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-12253.txt.
Introduction
Manish Shukla explains forecasts instead of just making them, applying two interpretation tools to a classic airline dataset, in a 2025 paper. Time series forecasts guide aviation, energy, retail, and health decisions, but the accurate models are often black boxes. Older statistical models explain themselves yet miss nonlinear patterns.
The study turns the monthly passenger series into a supervised learning problem without leaking the future. A gradient-boosted tree model trains alongside an ARIMA baseline. Then LIME and SHAP, two explanation methods, dissect the tree's predictions. A handful of lagged features, especially the value twelve months back, plus seasonal markers, explained most of the forecast variance. The paper contributes a chronology-safe method for explaining time series, a tour of the algorithms' theory, and practical guidelines. The case study doubles as a template for regulated industries that must justify predictions.
Catalog record
| CREATOR | Manish A. Shukla |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 17 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2508-12253
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Interpreting Time Series Forecasts with LIME and SHAP: A Case Study on the Air Passengers Dataset Manish A. Shukla Abstract Time-series forecasting underpins critical decisions across aviation, energy, retail and health. Classical autoregressive integrated moving average (ARIMA) models offer interpretability via coefficients but struggle with nonlinearities, whereas tree-based machine-learning models such as XGBoost deliver high accuracy but are often opaque. This paper presents a unified framework for interpreting time-series forecasts using local interpretable model-agnostic explanations (LIME) and SHapley additive exPlanations (SHAP). We convert a univariate series into a leakage-free supervised learning problem, train a gradient-boosted tree alongside an ARIMA baseline and apply post-hoc explainability. Using the Air Passengers dataset as a case study, we show that a small set of lagged features—particularly the twelve-month lag—and seasonal encodings explain most forecast variance. We contribute: (i) a methodology for applying LIME and SHAP to time series without violating chronology; (ii) theoretical exposition of the underlying algorithms; (iii) empirical evaluation with extensive analysis; and (iv) guidelines for practitioners. Keywords: time series forecasting, interpretability, LIME, SHAP, ARIMA, gradient boosting, Air Passengers 1 Introduction Forecasting sequences over time is a fundamental task in statistics and machine learning. Businesses rely on monthly revenue forecasts to set budgets, airlines schedule capacity based on passenger demand projections, and public health agencies monitor diseases using case counts. A persistent tension pervades this field: accuracy versus interpretability . On one hand, complex models such as gradient-boosted decision trees and recurrent neural networks excel at capturing nonlinear dynamics, interactions and seasonal patterns. On the other hand, domain experts often require transparent reasoning to audit predictions, troubleshoot failures or build trust. The demand for interpretability has intensified as machine-learning models increasingly influence high-impact decisions. Time-series data pose additional challenges for interpretability: observations are temporally ordered, so features used to predict a value at time t must depend only on past observations to avoid leakage; neighbourhood definitions for local methods must preserve realistic temporal patterns; and baseline distributions for additive methods must reflect seasonality. This paper addresses these challenges by combining the LIME and SHAP frameworks in a unified approach tailored to time series. Our primary case study is the Air Passengers dataset, a well-known benchmark recording monthly totals of international airline passengers from 1949 to 1960. We transform the series into a supervised table with lagged, rolling and seasonal features, train an ARIMA model and a gradient-boosted tree, and then apply LIME and SHAP to interpret the forecasts. The remainder of the paper is organised as follows. Section 2 reviews related work on time-series forecasting and interpretable machine learning. Section 3 introduces the Air Passengers dataset and describes feature engineering. Section 4 presents the modelling and interpretability techniques. Section 5 details the experimental setup and evaluation metrics. Section 6 reports empirical results with figures and tables. Section 7 discusses the findings and limitations. Section 8 concludes. 2 Related Work 2.1 Time-Series Forecasting Traditional statistical approaches emphasise parsimonious representations that capture dependence and seasonality. The Box–Jenkins ARIMA framework models a time series as a combination of autoregressive (AR) terms, differencing (I) and moving average (MA) terms. An ARIMA( p , d , q ) model is written as \Phi(B)(1-B)^{d}y_{t}=\Theta(B)\varepsilon_{t}, (1) where \Phi(B) and \Theta(B) are polynomials of order p and q in the backshift operator B , (1-B)^{d} denotes differencing d times and \varepsilon_{t} is white noise. Seasonal series may require SARIMA( p,d,q ) \times ( P,D,Q ) s models with additional seasonal operators. Model identification involves examining the autocorrelation function (ACF) and partial autocorrelation function (PACF), performing stationarity tests and using information criteria such as the Akaike Information Criterion (AIC) to select orders. Machine-learning models offer flexibility to capture nonlinear patterns. Gradient boosting builds an ensemble of decision trees by sequentially fitting weak learners to the residuals of previous models. XGBoost is a scalable implementation that introduces regularization, tree sparsity optimisation and cache awareness. Random forests, support vector machines and neural networks have also been applied to forecasting. These models typically require careful feature engineering when applied to time series, such as generating lagged variables, seasonal indicators and exogenous inputs. 2.2 Explainability Techniques Explainable artificial intelligence (XAI) seeks to bridge the gap between accuracy and interpretability. Two widely used model-agnostic methods are Local Interpretable Model-Agnostic Explanations (LIME) and SHapley Additive exPlanations (SHAP) . LIME approximates a complex model f around a point of interest \mathbf{x} by training an interpretable surrogate model using locally weighted perturbed samples. SHAP derives from Shapley values in cooperative game theory and expresses the prediction as a sum of a baseline and feature contributions that satisfy local accuracy, missingness and consistency properties. Although LIME and SHAP have been applied extensively to tabular and image data, their application to time series is less explored due to challenges around leakage and neighbourhood definitions. This paper adapts these techniques to time-series forecasting. 3 Dataset and Feature Engineering 3.1 Air Passengers Dataset The Air Passengers dataset contains monthly totals of international airline passengers, measured in thousands, from January 1949 to December 1960. The series exhibits an exponential growth trend and a strong yearly seasonal pattern. Observations range from approximately 104 thousand passengers in early 1949 to 622 thousand in late 1960. Figure 1 plots the observed series together with the ARIMA and XGBoost forecasts. We log-transform the series and difference it when fitting ARIMA models to stabilise variance and achieve stationarity. Figure 1: Monthly international airline passengers (blue) with ARIMA and XGBoost forecasts (red and green) for 1959–1960. Values are measured in thousands. 3.2 Supervised Learning Formulation To apply machine-learning algorithms, we convert the univariate series into a supervised table. For each time t we define a feature vector \mathbf{x}_{t} and target y_{t} . Features include: (i) lagged values \text{lag}_{k}(t)=y_{t-k} for 1\leq k\leq 12 ; (ii) rolling statistics , such as the 12-month rolling mean \text{rollmean}_{12}(t)=\tfrac{1}{12}\sum_{i=1}^{12}y_{t-i} and rolling standard deviation; and (iii) seasonal encodings using sine and cosine transforms of the month index m , namely \sin(2\pi m/12) and \cos(2\pi m/12) . These encodings capture cyclic behaviour and avoid discontinuities between December and January. All features are computed using only past observations to avoid leakage. 3.3 Descriptive Statistics and Correlation Analysis Table 1 summarises basic statistics of the passenger counts. The mean passenger count is approximately 159.4 thousand with a standard deviation of 40.3 thousand; the minimum and maximum are 79 and 243 thousand, respectively. Table 2 lists the Pearson correlations between y_{t} and lagged values. The correlation peaks at lag 12 (0.98), confirming the dominance of yearly seasonality. Statistic Mean Std. Dev. Min 25% 50% 75% Max Passengers (k) 159.4 40.3 79 129 160.5 191 243 Table 1: Descriptive statistics of the Air Passengers series (in thousands). Quartiles correspond to the 25%, 50% and 75% percentiles. Lag 1 2 3 4 5 6 7 8 9 10 11 12 Correlation 0.94 0.87 0.79 0.70 0.60 0.38 0.31 0.25 0.19 0.14 0.09 0.98 Table 2: Pearson correlation between the target and lagged values \text{lag}_{k}(t) . The correlation peaks at lag 12, indicating strong yearly seasonality. 4 Methodology 4.1 Models We compare two forecasting models: a seasonal ARIMA (SARIMA) model and a gradient-boosted tree . For the ARIMA baseline, we difference the logged series to achieve stationarity and select orders (p,d,q) and (P,D,Q)