# Interpretability Study of Gradient Information in Individual Travel Prediction
## 2 Related Work
### Post Hoc Interpretability Framework  
To compensate for the limitations of the transparent model interpretability framework, the post hoc interpretability framework adds an additional model architecture on top of the original model to specifically explain the decision-making process of the original model [21]. As a representative of this framework, SHapley Additive exPlanations (SHAP) [7] provides a new perspective for explaining predictions from any machine learning model with its unique capabilities. SHAP is a game theory-based model explanation method that can effectively reveal relationships between travel features [22; 23; 24; 25; 26]. The core idea is to calculate the Shapley value of feature contributions, treating machine learning predictions as the outcome of a cooperative game between \"feature players\". Each feature's contribution \(\varphi_{i}\) is calculated by the weighted average of its marginal contributions as follows:  
\[\varphi_{i}=\sum_{S\subseteq F\backslash\{i\}}\frac{|S|!(|F|-|S|-1)!}{|F|!}(v (S\cup\{i\})-v(S)) \tag{4}\]  
where, \(v(S\cup\{i\})-v(S)\) represents the marginal contribution of \(i\) to \(S\); \(S\subseteq F\backslash\{i\}\) indicates the need to sum up all possible alliances; \(\frac{|S|!(|F|-|S|-1)!}{|F|! }\) represents the weight of the alliance. SHAP can be defined, for an input sample \(x\), its prediction \(f(x)\) can be expressed as the sum of a baseline value \(\varphi_{0}\) and the contributions of each feature \(\varphi_{i}\):  
\[f(x)=\varphi_{0}+\sum_{i=1}^{M}\varphi_{i} \tag{5}\]  
To obtain the precise Shapley values for all features, it means generating all possible feature coalitions for the input, which grows exponentially with the number of features in the model. To reduce computational complexity, KernelSHAP [27] approximates the local behavior of complex models with a linear model of feature importance, defining a kernel-weighted squared loss function as follows:  
\[L=\sum_{z^{\prime}}[f(h_{x}(z^{\prime}))-g(z^{\prime})]^{2}\pi_{x}(z^{\prime}) \tag{6}\]  
where \(z^{\prime}\) is the feature mask vector, \(h_{x}\) is the feature mapping function, \(g\) is the linear explanation model, and \(\pi_{x}\) is the sample weight kernel function. Although KernelSHAPhas been widely adopted, its perturbation only affects the instance being explained and ignores the model's hidden states, meaning that in the field of travel prediction dominated by RNNs, there is a mismatch between the data KernelSHAP assigns importance to and the data the model actually relies on. Further, TimeSHAP [28] builds on KernelSHAP and extends it to the sequence domain. TimeSHAP is implemented through KernelSHAP's sampling framework, but modifies the feature mask generation logic \(z^{\prime}\) expanding it from a single-time feature mask to a time-slice level mask, thus solving the interpretability problem in time series prediction. The method uses a linear explainer \(g\) to approximate the model's local behavior as follows:  
\[f(h_{X}(z))\approx\text{g}(z)=w_{0}+\sum_{i=1}^{m}w_{i}z_{i} \tag{7}\]  
TimeSHAP approximates the local behavior of complex explainers through the calculation of the loss function, allowing the explainer to simultaneously capture feature interactions across time steps. TimeSHAP can explain which features in history have the largest impact on the current prediction [29]. A prominent issue with TimeSHAP is that the computational time grows exponentially with the length of the observation sequence [30], making the computational cost prohibitive when handling longer sequences. Unlike the global explanations provided by SHAP, Local Interpretable Model-agnostic Explanations (LIME) [8] is a local explanation method that simplifies the decision boundary of a complex model into a linear hyperplane around the target point using local linear approximation. For a target sample \(x\), LIME generates a set of perturbed samples \(\{z_{i}\}\) in its neighborhood.