## 3 Methods
### Random Forest Model Construction and Parameters Optimization
#### 3.3.2 Model Parameter Optimization  
The key parameters in random forest modeling are shown in Table 3. Different parameter combinations have a significant impact on the performance of the random forest model. Therefore, adjusting the parameters of the random forest algorithm is the key step to optimizing model performance. In this paper, we compare and analyze the methods of model parameter optimization, including random search, grid search, genetic algorithm, simulated annealing, Bayesian optimization based on Gaussian process, and Bayesian optimization based on gradient boosting regression trees. The R2_score is used to assess the fitness of each decision tree, serving as a critical indicator of the overall model fitting performance. In the process of random forest construction, it is common to utilize methods like random search and grid search to select parameters such as the depth of decision trees, the number of leaf nodes in each tree, and the number of nodes for splitting in each tree. The random search is a method to randomly select parameter combinations in the parameter space, allowing for exploration of a larger parameter space. While it efficiently explores different combinations, it may require more iterations to find the optimal parameter combination. Grid search systematically traverses the parameter space by training and evaluating the model for each possible parameter combination. It ensures comprehensive parameter space exploration but might face computational resource challenges, particularly in large parameter spaces. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Function** \\ \hline n\_estimators & The number of decision trees in the forest. Increasing the value of this parameter can enhance the model’s accuracy and robustness. However, it can also increase the computation time and memory usage. The maximum depth of each decision tree, which controls the complexity of the model and the risk of overfitting. If the depth of the tree is too large, the model might overfit. If it’s too small, the model might underfit. \\ max\_features & The number of features randomly chosen at each node, which can make the model more randomized and reduce the risk of overfitting when increased. However, it might also decrease the accuracy of the model prediction. \\ min\_samples\_split & The minimum number of samples required to continue splitting at each node, which can prevent overfitting by increasing its value. But this might reduce the sensitivity of the model. \\ min\_samples\_leaf & The minimum number of samples required in each leaf node, which can prevent overfitting. Increasing this value can stabilize the model, but it might affect the sensitivity of the model. \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Key parameters of the random forest model. Genetic algorithm is an optimization algorithm inspired by natural selection and genetic mechanisms. It simulates the genetic process in biological evolution, searching the solution space of the problem through genetic operations. Genetic algorithm possesses global search capabilities, allowing for extensive exploration within the solution space. By employing crossover and mutation operations on multiple individuals within populations, genetic algorithms can escape local optima and strive to find the global optimum. Simulated annealing algorithm is derived from the physical process of annealing in solids. The idea comes from the fact that in solid-state annealing, gradually lowering the temperature allows atoms to move towards an equilibrium state, resulting in the optimal crystalline structure. This method avoids falling into local optimal solutions by accepting suboptimal solutions with a certain probability in the search space. Bayesian optimization is a method of optimizing black-box functions by building models, suitable for scenarios, where minimizing or maximizing an objective function is challenging or unknown.