## 4 Parameters Optimization
False Negative (FN) represents a missing report, that is, the number of correct matches that are not found. False Positive (FP) refers to a false alarm, i.e., the given match is incorrect. True Negative (TN) represents the number when both reality and prediction are errors. Based on the confusion matrix, it is easy to obtain the evaluation indexes of the two classification algorithms, such as precision, recall, F value, and accuracy. Accuracy is the most common evaluation index, which is the number of correct samples divided by the number of all of the samples. The higher the accuracy, the better the algorithm, which is a very intuitive evaluation index. Nevertheless, sometimes, high accuracy does not mean that an algorithm is good. When the operation set is a deviation class, it will appear that the accuracy is high, but the model is not good. Therefore, it is not feasible to use only accuracy. Accuracy is defined as follows:  
\[\text{Accuracy}=(\text{TP}+\text{TN})/(\text{TP}+\text{FP}+\text{TN}+\text{ FN}) \tag{15}\]  
Precision (P) and recall (R) are also two metrics that are widely used in statistical theory to evaluate the quality of results. They are defined as follows:  
\[\text{P}=\text{TP}/(\text{TP}+\text{FP}) \tag{16}\]  
\[\text{R}=\text{TP}/(\text{TP}+\text{FN}) \tag{17}\]  
To evaluate the merits and demerits of different algorithms, the concept of the F value is proposed based on accuracy and recall. The F value considers the P value and the R value synthetically, and when it is high, the algorithm is effective. The F value is defined as follows:  
\[\text{F}=2*\text{P}*\text{R}/(\text{P}+\text{R}) \tag{18}\]  
In the data used in this experiment, positive samples account for one-third of the data, while negative samples account for two-thirds of the data. The data set has a certain level of deviation, which also makes the F value an important metric. The top 20 sets of parameter values with the best metrics are shown in Table 3. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Prediction True** & **Prediction False** \\ \hline True Reality & True Positive (TP) & False Negative (FN) \\ False Reality & False Positive (FP) & True Negative (TN) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Confusion Matrix. When the gamma is fixed at 0.1, with the change of C, the variation of metrics is shown in Figure 6.  
As can be seen from the figure, when gamma = 0.1, with the continuous increase in C, both the F value and accuracy have a trend that is first constant, followed by an increase and then a reduction. When C is small, the penalty factor is small. This happens when the penalty term is multiplied by the penalty factor equal to approximately 0, i.e., the penalty factor has little effect on the result of the algorithm model because the value is too small, which also explains why the F value and accuracy are almost constant, even if the penalty factor of the first half is constantly increased. The numerical value of the whole graph shows an initial increase followed by a decrease, indicating that a larger parameter is not better. When the parameter value increases to a certain value, the prediction effect will be reduced. As can be seen from the figure, the initial accuracy is only about 70%, which is merely