Prediction of Ag nanoparticle core size: impact of feature encoding on regression machine learning models
摘要
This study systematically investigates the influence of categorical variable encoding on the performance and robustness of machine learning models for predicting the core size of silver nanoparticles (AgNPs). While previous studies have largely relied on numerical variables, important categorical synthesis parameters such as the class of reducing agents, the presence of capping agents, and the type of external energy applied are often overlooked. Their exclusion can result in incomplete data representation and potential predictive bias. In this work, model representativeness is enhanced by the reduction of predictive bias and the improved representation of diverse synthesis conditions, particularly those that are underrepresented in the dataset. Four gradient boosting algorithms, namely extreme gradient boosting (XGB), light gradient boosting machine (LGB), CatBoost, and histogram gradient boosting (HGB), were evaluated using a dataset of 1799 samples, with an 80:20 train–test split. Seven categorical variables were converted into numerical form using label encoding. Among the models, HGB demonstrated superior predictive performance, achieving the highest coefficient of determination (R2 = 0.97) and the lowest root mean square error (RMSE = 2.22) on the test dataset. Model interpretability and robust were further examined using SHapley Additive exPlanations (SHAP) and residual analysis to identify feature importance and potential systematic bias. The results indicate that incorporating encoded categorical variables improves both predictive accuracy and representativeness by capturing complex synthesis relationships more effectively. In contrast, models such as XGB showed greater susceptibility to overfitting when handling encoded features. Overall, this study highlights the importance of integrating categorical synthesis parameters to enhance predictive reliability and reduce bias in nanomaterial design.
Graphical abstract