## 3 Improved Snake Optimization Algorithm for Melting Point Optimization Solution
### Modeling Effect and Analysis  
To compare the modeling effect of each algorithm, four evaluation indexes, namely, coefficient of determination (\(R^{2}\)), root mean square error (\(RMSE\)), mean absolute error (\(MAE\)), and mean relative error (\(MRE\)), are selected for comparison in this study.  
The coefficient of determination (\(R^{2}\)) measures the proportion of the total variation in the dependent variable that is explained by the model. Its value ranges from 0 to 1, with values closer to 1 indicating stronger explanatory power of the model. The formula is shown in Equation (26).  
\[R^{2}=1-\frac{\sum{(y_{i}-\hat{y}_{i})^{2}}}{\sum{(y_{i}-\overline{y})^{2}}} \tag{26}\]  
\(RMSE\) measures the deviation between the model's predicted value and the true value, with smaller values indicating higher predictive accuracy of the model. The formula is shown in Equation (27).  
\[RMSE=\sqrt{\frac{1}{n}{\sum_{i=1}^{n}{(y_{i}-\hat{y}_{i})^{2}}}} \tag{27}\]  
\(MAE\) measures the mean absolute error between the predicted and actual values, with smaller values indicating better predictions from the model. The formula is shown in Equation (28).  
\[MAE=\frac{1}{n}{\sum_{i=1}^{n}{|y_{i}-\hat{y}_{i}|}} \tag{28}\]  
\(MRE\) measures the average proportion of prediction error relative to the actual value, with smaller values indicating smaller relative errors and better performance of the model. The formula is shown in Equation (29).  
\[MRE=\frac{1}{n}{\sum_{i=1}^{n}{\left|\frac{y_{i}-\hat{y}_{i}}{y_{i}}\right|}} \tag{29}\]  
Catboost, XGBoost, and LightGBM with default parameters and TPE-Catboost, TPE-XGBoost, and TPE-LightGBM optimized with TPE hyperparameters are compared, respectively, and the results of the comparisons of each index are shown in Table 4.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & \(\mathbf{R^{2}/(\%)}\) & \(RMSE^{\prime}\)C & \(MAE/^{\circ}\)C & \(MRE/(\%)\) \\ \hline XGBoost & 88.99 & 8.12 & 7.19 & 10.09 \\ LightGBM & 89.57 & 8.02 & 7.02 & 9.81 \\ Catboost & 89.91 & 8.02 & 6.97 & 9.41 \\ TPE-Catboost & 93.89 & 7.02 & 6.19 & 7.88 \\ TPE-XGBoost & 92.55 & 7.41 & 6.33 & 8.18 \\ TPE-LightGBM & 92.81 & 7.29 & 6.38 & 8.05 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Model Accuracy Comparison.  
As shown in Table 4, the coefficient of determination (\(R^{2}\)) of the XGBoost, LightGBM, and CatBoost models with the default hyperparameters consistently hovers around 89% on the actual production dataset of the smelter. Subsequent optimization of the model hyperparameters using the Tree-structured Parzen Estimator (TPE) resulted in an increase in the average \(R^{2}\) to 93%, which is a 4% improvement over the default parameters. Additionally, this optimization resulted in a reduction of 1.03 \({}^{\circ}\)C in the Root Mean Square Error (_RMSE_), 0.87 \({}^{\circ}\)C in the Mean Absolute Error (_MAE_), and 1.59% in the Mean Relative Error (_MRE_). These results highlight the efficacy of TPE-based hyperparameter tuning in improving model accuracy.  
Among the three hyperparameter-optimized models, the average R\({}^{2}\) of the TPE-CatBoost model is better than the comparable models by 1.5%. In addition, the RMSE, MAE, and MRE were also significantly reduced. In summary, the TPE-CatBoost model shows better adaptability in predicting the melting point of slag in zinc smelting, which plays a positive role in future research on melting point optimization in the industrial field.