# An Interpretable XGBoost Framework for Predicting Oxide Glass Density
## 4 Discussion  
The results of this study provide a comprehensive demonstration of how machine learning, when coupled with thoughtful feature engineering, can not only accurately predict a fundamental material property like glass density but also offer profound insights into the underlying physical principles governing it. The central finding is the clear, hierarchical improvement in predictive performance corresponding to the increasing physical and chemical sophistication of the feature sets used. This underscores that for data-driven materials science, the representation of the material, the features, is as important as the learning algorithm itself. A striking observation is the performance gap between the simple linear model (ElasticNet) and the more complex, non-linear models (XGBoost, MLP) across the different feature sets. The ElasticNet model's heavy reliance on the quality of the input descriptors is evident in its poor performance with purely Compositional features and its considerable improvement with the Meredig and Magpie sets. In contrast, the XGBoost and MLP models, capable of capturing intricate non-linear relationships, achieve a respectable R\({}^{2}\) of c.a. 0.9 even with the most basic compositional data. This indicates their ability to autonomously learn some of the complex interplay between elements. However, their performance is  
Figure 7: SHAP beeswarm plot for XGBoost model for feature sets: (**a**) Compositional; (**b**) Atomic types; (**c**) Meredig, (**d**) Magpie (limited to 20 of the most important features). also significantly enhanced by the physically informed features, with the XGBoost model reaching a very good R\({}^{2}\) of 0.97 with the Magpie set. Adding attributes that classify atoms by their structural role (Atomic type features) consistently provided a modest but clear improvement over purely compositional data, confirming that even a basic level of physical intuition encoded into the features is beneficial. The most compelling insight from this work comes from the feature importance and SHAP analysis of the best-performing XGBoost model. When trained on the advanced Meredig and Magpie sets, the model's decision-making process converged on a strategy that mirrors the fundamental definition of density. The model correctly identified mean atomic weight as the single most dominant feature, which serves as a direct and effective approximation for the molar mass of the glass. The SHAP analysis confirms this with a clear, near-linear positive relationship between this feature's value and its impact on the predicted density. Furthermore, the model learned to approximate the molar volume, a more complex term related to atomic packing, coordination, and bonding by leveraging features describing the electronic structure of the constituent atoms. Attributes such as the average fraction of s, p, and d valence electrons emerged as highly important predictors. This is physically sound, as the electronic configuration dictates bonding characteristics and atomic radii, which in turn determine the efficiency of atomic packing. For instance, the model learned that a higher fraction of d-valence electrons, typical for heavier transition metals, contributes to a higher predicted density. This demonstrates that the algorithm did not merely memorize data points but constructed a robust, physically acceptable framework to solve the problem. The SHAP analysis of the simple Compositional features reveals that high Si, B, and P content (red dots) have strongly negative SHAP values. Thus, increasing the content of these elements lowers the predicted glass density. This is entirely expected--the oxides SiO\({}_{2}\), B\({}_{2}\)O\({}_{3}\), and P\({}_{2}\)O\({}_{5}\) are classical network-forming elements that form lightweight, relatively open, low-density spatial structures (e.g., the density of quartz glass SiO\({}_{2}\) is approximately 2.2 g/cm\({}^{3}\)). The proportion of Pb has the strongest effect on the model. High Pb content (red dots) has very high positive SHAP values.