## 2 Materials and Methods  
### Shapley Values  
Shapley values are a concept taken from cooperative game theory and are used to attribute a player's contribution to the end result of a game [10]. Let us consider a cooperative game where a set of players each collaborate to create some value. If we can measure the total result of the game, Shapley values capture the marginal contribution of each player to the end result. Now, let us imagine a machine learning model as a game in which features cooperate to produce a model output and associate to each feature a contribution in terms of the Shapley value. A Shapley value for a feature is computed by the difference between the prediction of the model output with that feature and the prediction of the model without that feature. This method requires re-training the model on all features subsets \(S\subseteq F\), where \(F\) is the set of all features. If we consider a generic model \(f\), we can denote a model trained with the \(i\)-th feature present as \(f_{S\cup\{i\}}\) and a model trained without the \(i\)-th feature as \(f_{S}\). Then, predictions from the two models are compared on the difference \(f_{S\cup\{i\}}(x_{S\cup\{i\}})-f_{S}(x_{S})\), where \(x_{S}\) and \(x_{S\cup\{i\}}\) represent the values of the input features in the set \(S\) and \(S\cup\{i\}\), respectively. We need to sum this term over all the possible combinations of subsets \(S\) to get \(\phi_{i}\), the marginal value of adding the \(i\)-th feature to the training. This can be accomplished by adding the weighted average among all possible differences that give the Shapley value of the \(i\)-th feature, as follows:  
\[\phi_{i}=\frac{1}{|F|}\sum_{S\subseteq F\setminus\{i\}}\binom{|F|-1}{|S|}^{- 1}[f_{S\cup\{i\}}(x_{S\cup\{i\}})-f_{S}(x_{S})], \tag{1}\]  
where \(|S|\) and \(|F|\) are the cardinalities of \(S\) and \(F\), respectively. The combinatorial term calculates how many permutations of each subset size we have when constructing it among all remaining features excluding feature \(i\). We then use this combinatorial term to divide the marginal contribution of the feature \(i\) to all groups of size \(|S|\). In addition, we have to divide them by the number of features participating in the model prediction, that is, the total number of features \(F\). This term is needed to average out the effect of how much the feature \(i\) contributes regardless of the size of the total number of features. We can use these values as contributions of the features for the model output. Indeed, we can define an _explanation model_\(g\) as a linear function of the feature contributions [9]:  
\[g(z)=\phi_{0}+\sum_{i=1}^{M}\phi_{i}z_{i}\quad, \tag{2}\]  
where \(\phi_{0}\) is the SHAP value equal to \(E[f(z)]\) (i.e., the average of the samples' outcomes), \(z_{i}\) are binary variables with \(z_{i}\in\{0,1\}\), \(M\) is the number of input features, and binary values refer to the presence (1) or absence (0) of a feature. Shapley values satisfy the local accuracy and consistency properties [9], but still cannot handle missing values. In order to also satisfy the missingness property, [PERSON] and [PERSON] proposed SHAP values, which are explained in Section 2.2.