## 3 Results and Discussion
### Electronic Nose Detection
#### 3.1.7 Classification Model Evaluation and Optimization  
By dividing the training set into 60% for training and 40% for testing, the accuracy of the classification predictions can be assessed. The specific data presented in Table 5 illustrate the distribution of training and testing samples, along with the samples that exhibited prediction errors. The classification predictions for each item indicate that the accuracy achieved after LDA dimensionality reduction is significantly higher than that obtained through PCA. Additionally, the scatter plot comparing the two methods in the previous section demonstrates that the classification performance of LDA is superior. When applying the same dimensionality reduction method to both RF and SVM, the prediction accuracies are nearly identical; however, the accuracy of the RF model improves consistently with an increase in the number of decision trees. Consequently, the optimized RF model outperforms SVM.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{\begin{tabular}{c} **Oyster Storage** \\ **Temperature** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **Dimensionality** \\ **Reduction** \\ **Method** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **Number of** \\ **Decision** \\ **Trees** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **Classification** \\ **Labels (by** \\ **Detection** \\ **Hours)** \\ \end{tabular} } & \multirow{2}{*}{\
\begin{tabular}{c} **Number of** \\ **Training** \\ **Samples** \\ **(Group)** \\ \end{tabular} } & \multirow{2}{*}{
\begin{tabular}{c} **Number of** \\ **Predicted** \\ **Tes Samples** \\ **(Group)** \\ \end{tabular} } & \multirow{2}{*}{**Accuracy**} \\ \cline{1-1}  & & & & & & & \\ \hline
4 \({}^{\circ}\)C & PCA & 10 & 0–216 h & 555 &  
Optimizing the prediction model can significantly enhance its accuracy. In the random forest (RF) model, both the number of decision trees and the maximum depth of these trees can be adjusted to improve prediction accuracy. The depth of a decision tree directly influences the model's complexity; deeper trees tend to have more intricate structures and must accommodate a greater number of features and rules, thereby increasing complexity. However, excessive complexity may compromise the model's generalization ability, rendering it more vulnerable to noise and outliers. Consequently, it is crucial to strike a balance between accuracy and complexity when determining the depth of the decision tree to ensure that the model effectively fits the data while maintaining robust generalization capabilities. In previous experiments, various quantities of decision trees were tested, ultimately selecting 100 trees based on comparative analysis, as illustrated in Table 5, which presents a portion of the data following LDA dimensionality reduction at different depths.  
The results indicated that altering the maximum depth of the decision tree did not impact the accuracy of the LDA dimensionality reduced data fed into the RF model. Conversely, the accuracy of the PCA dimensionality reduced data initially increased and then decreased with adjustments to the maximum depth of the decision tree. Therefore, when constructing an RF model, it is essential to select not only the appropriate number of decision trees but also to fine-tune the depth of the decision trees to ensure optimal overall model accuracy.