## 3 LIB SOH Prediction Case Study and Analysis
### Parameter Optimization Based on PSO  
The RF improved model builds upon the Class RF model by incorporating the PSO algorithm for adaptive parameter tuning. It iteratively searches for the best position, and there is a strong interdependence between iterations, making it challenging to achieve full parallel computation. Consequently, the computational complexity of the RF improved model is relatively high. While ensuring the adequate performance of different models, the iteration times for the PSO algorithm was set to 10 iterations. Through measurement, the runtime for the Class RF model is 7.79 s, while the RF improved model 1, optimized for three parameters, has a runtime of 65.22 s, and the RF improved model 2, optimized for five parameters, has a runtime of 89.40 s. This indicates that the proposed RF improved  
\begin{table}
\begin{tabular}{l c} \hline \hline
**Feature** & **Important** \\ \hline discharge capacity (Ah) & 0.238030 \\ cycle index & 0.193353 \\ discharge energy (Wh) & 0.163842 \\ charge capacity (Ah) & 0.148204 \\ discharge time & 0.135424 \\ charge energy (Wh) & 0.104562 \\ net discharge energy (Wh) & 0.010945 \\ mean voltage (V) & 0.003314 \\ constant current charge capacity (Ah) & 0.001290 \\ constant current charge ratio (\%) & 0.000938 \\ charge time & 0.000053 \\ net discharge capacity (Ah) & 0.000025 \\ charge–discharge efficiency (\%) & 0.000020 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Initial feature selection and feature-importance ranking based on #1 LIB experimental data.  
Figure 6: The key code for feature importance ranking.  
\begin{table}
\begin{tabular}{l c} \hline \hline
**Feature** & **Important** \\ \hline cycle index & 0.226575 \\ discharge time & 0.202087 \\ discharge capacity (Ah) & 0.164712 \\ charge capacity (Ah) & 0.139227 \\ discharge energy (Wh) & 0.131437 \\ charge energy (Wh) & 0.101534 \\ net discharge energy (Wh) & 0.034428 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Final feature selection and feature-importance ranking based on #1 LIB experimental data.  
model in this paper comes with significant computational complexity. The key code for parameter optimization based on the PSO algorithm is shown in Figure 7.  
Randomly selecting 90% of the charge-discharge cycle experimental data from #1, #6, and #26 LIB for model training sets and reserving the remaining 10% for testing sets, the major parameter values for the Class RF model, RF improved model 1, and RF improved model 2 are presented in Table 6. For the Class RF model, parameters were adjusted based on manual experience. RF improved model 1 employed the PSO algorithm to optimize max_depth, n_estimators, and max_features, while keeping the other two parameters consistent with the Class RF model. RF improved model 2 used the PSO algorithm to optimize max_depth, n_estimators, max_features, min_samples_split, and min_samples_leaf, involving the optimization of five parameters.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**LIB** & **Parameter** & **Class RF Model** & **RF Improved Model 1** & **RF Improved Model 2** \\ \hline \multirow{8}{*}{\#1} & max\_depth & 13.14 & 9.35 & 18.47 \\  & n\_estimators & 100 & 64.06 & 98.51 \\  & max\_features & 10 & 1 & 1 \\  & min\_samples\_split & 2 & 2 & 2.97 \\  & min\_samples\_leaf & 1 & 1 & 2.31 \\  & max\_depth & 12.71 & 12.26 & 11.64 \\  & n\_estimators & 100 & 11.07 & 8.08 \\ \#6 & max\_features & 10 & 0.94 & 0.51 \\  & min\_samples\_split & 2 & 2 & 2 \\  & min\_samples\_leaf & 1 & 1 & 1 \\  & max\_depth & 11.69 & 10.02 & 8.28 \\  & n\_estimators & 100 & 88.84 & 124.51 \\ \#26 & max\_features & 10 & 1 & 1 \\  & min\_samples\_split & 2 & 2 & 4.02 \\  & min\_samples\_leaf & 1 & 1 & 2.48 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Parameter values for different RF models.  
Figure 7: The key code for PSO algorithm parameter optimization.