Application of random forest regression in modeling the adsorption of methylene blue onto clays
摘要
The prediction of adsorption equilibrium in heterogeneous systems remains challenging due to the variability of experimental conditions and the lack of generalizable models across independent studies. In this work, a machine learning approach based on random forest regression was developed to predict the equilibrium adsorption (qe) of methylene blue (MB) onto clays, considering both material properties and operational conditions. The model was built using a compiled dataset from 38 independent studies, comprising 1,098 adsorption experiments. Due to incomplete reporting of key variables, multiple models were constructed using different subsets of features. Under conventional cross-validation, the models achieved high predictive performance (R² up to 0.99), indicating a strong ability to reproduce observed data within the available dataset. However, a more rigorous evaluation based on group-based cross-validation, which accounts for correlations among data from the same study, resulted in a significant reduction in performance (R² ≈ 0.66; MAE ≈ 48; RMSE ≈ 69), providing a more realistic assessment of model generalization. Among the evaluated models, the formulation using a reduced set of variables and the largest dataset (Model M5, 726 experiments from 23 studies) showed the most consistent performance under this framework. The model successfully captured key adsorption trends, including the influence of pH, initial dye concentration, and clay activation. The results highlight that, while conventional validation may overestimate predictive performance, more stringent validation strategies are essential for assessing model robustness across heterogeneous datasets. This study provides a step toward the development of more generalizable predictive tools for adsorption systems.