## 3 Results
### Mortality Risk Prediction Based on SHAP Interpretation Machine Learning
#### 3.4.2 Interpreting the Model Locally  
(1) Decision Path.  
As Figure 9. In the SHAP decision diagram, the gray vertical line in the middle represents the base values of the model, while the colored lines represent the effect of each feature on the predicted results. These values are responsible for moving the output above or below the average prediction. The prediction lines, which commence at the base values, illustrate the accumulation of SHAP values, culminating in the final model score.  
The decision diagram was plotted for the first 100 patients, which revealed that the patients began with a basic value of 0.6225. As the value of each characteristic changed, the SHAP value was affected, ultimately influencing the patient's risk of death. The red line indicates that the patient's risk of death is higher than the mean value due to the combined effect of the characteristics. In contrast, the blue line represents the opposite.  
(2) The Interpretation of Individual Cases.  
A further understanding of the direction and magnitude of the influence of individual characteristics on the risk of death in patients with primary thyroid lymphoma can be achieved by analyzing individual patients using SHAP. As Figure 10.  
Figure 8: The impact of two-by-two interaction characteristics on prediction outcomes.  
Figure 9: Decision charts for the first 100 patients.  
The results shown in the graph are logarithmically related to the predicted probabilities, i.e., \(f(x)=\ln(p/(1-p))\). The above graph illustrates the relationship between a variable and a predicted outcome. The red color represents a positive contribution to the predicted outcome, while the blue color represents a negative impact. The size of the colored area reflects the magnitude of the impact. The probability of survival for the 30 th patient is 0.5796, while the displayed result is 0.321. For this patient, the contribution of age (Age = 53) is significant, followed by number of malignancies (numberrecode = 2) and marital status (Marital = 1). The combined effect of all the characteristics resulted in a SHAP value for this patient of less than 0.6225, indicating that the risk of death for this patient was lower than the baseline risk.  
The vertical axis represents the different features and the values taken by the features. The horizontal axis represents the SHAP value. \((f(x))\) is the expectation of all the samples. The value of \((x)\) denotes the prediction result of the 30 th patient. The red feature represents the promotion of the patient's death, while the blue feature denotes the reduction of the patient's death. The width of the feature indicates the degree of its influence on the outcome. Therefore, the wider the width of the feature, the greater the influence on the final predicted outcome. As shown in Figure 11, As illustrated in the preceding graph, the three most influential features for the 30 th patient were age, number of malignancies, and marital status.  
In conclusion, SHAP offers an efficacious interpretive analysis of XGBoost when performing mortality risk prediction in patients with primary thyroid lymphoma. In addition to ranking the overall feature importance, the tool revealed the direction of influence of each variable in the model on the prediction results. Furthermore, it enabled local analysis of individual samples. This enables doctors to gain insights into each patient's  
Figure 11: Importance of characteristics of 30 th patient.  
Figure 10: Interpretation of the SHAP model for the 30 th patient.  
condition, which in turn assists them in developing personalized treatment plans and targeting therapeutic measures, thereby reducing the risk of patient mortality.