## 2 Materials and Methods
We can get further global insight into the ML model based on the so-called SHAP dependence plots. They show the marginal effect of one or two variables on the predicted outcome of an ML model [37, 40]. The variable that is found to have the greatest interaction with the analyzed variable is automatically included in the diagram. A typical form is given in Figures 9 and 10. Figure 9 shows the SHAP dependence plot for variable X (preoperative forced vital capacity). The most influential variable on X is variable Z (preoperative vital capacity in inspiration). The value of the variable Z is coded according to the color map given on the right side of the plot, with red corresponding to large and blue to small values. Figures 10 and 11 show the SHAP dependence plot for variable P (Chronic Obstructive Pulmonary Disease index). The most influential variable on P is variable V (preoperative vital capacity). A rather linear dependence of P and the magnitude of its influence on the output of the ML system can be clearly seen, except for the interval PP \(\in\) [1.6, 2] in which we observe the effect of saturation. As for the most influential variable V, its large values correspond to this saturation region, while its small values are associated with small values of P and its negative influence on the postoperative FEV1%. Namely, for \(p<1.5\) its SHAP values are negative. Figure 9: Absolute SHAP values averaged over the entire training set corresponding to the 7 th postoperative day. Figure 11: SHAP dependence plot for variable P—Chronic Obstructive Pulmonary Disease index. The most influential variable on P is variable V—preoperative vital capacity. The value of the variable V is coded according to the color map given on the right side of the plot—red corresponds to large and blue to small values. A rather linear dependence of P and the magnitude of its influence on the output of the ML system can be clearly seen, except for the interval \(\text{PP}\in[1.6,\,2]\) in which we observe the effect of saturation. As for the most influential variable V, its large values correspond to this region of saturation, while its small values are associated with small values of P and its negative influence on postoperative FEV1%. Namely, for \(p<1.5\) its SHAP values are negative. Figure 4:0 SHAP dependence plot for variable X—preoperative forced vital capacity. The most influential variable on X is variable Z—preoperative vital capacity in inspiration. The size of the variable Z is coded according to the color map given on the right row—red corresponds to large and blue to small values. One can clearly see the almost linear dependence of the size of X and the size of its influence on the output of the ML system. ### Local Interpretability

The special value of the SHAP method is local interpretability, i.e., the possibility of obtaining the so-called individual SHAP value plot for each individual observation. In Figures 12 and 13, two such waterfall plots are given for two characteristic patients n1 and n2 from our training set, respectively. Figure 4:1 Individual SHAP value plot for patient n1. The base value of FEV1% = 44.871 at the bottom, is the average ML output for all observations. The model prediction for this patient is FEV1% = 34.467, as shown at the top. The graphic shows the reason for obtaining a specific prediction for a given patient and his preoperative characteristics. To analyze Figure 12, start at the bottom of the waterfall chart and add (red) or subtract (blue) values to arrive at the final prediction. It starts with a base value of 44,871 at the bottom, which is the average ML output for all observations. This value can also be interpreted as the expected prediction of the ML model when there is no single preoperative measurement. The model prediction for this patient is 34,467, as shown at the top. On the left side of the figure, the input values of the preoperative variables for

Figure 4:2 Individual SHAP value plot for patient n2.