## 3 Results and Discussion
### Final Performance Evaluation  
As seen in Table 12, the optimal KNN model performed very well on the training data, but the generalization performance of the optimal KNN model was worse than the performance on the training set. Therefore, it obviously suffered from overfitting. However, it cannot be denied that the optimal KNN model achieved a good \(R^{2}\) score of 0.7128. As shown in Table 13, the optimal CART model performed well on the training set, whereas the generalization performance of the optimal CART model was not as good as the performance on the training data. Thus, it apparently suffered from overfitting. However, it cannot be denied that the optimal CART model achieved a good \(R^{2}\) score of 0.7173. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model Performance** & **MSE** & **RMSE** & \(R^{2}\) \\ \hline Training error & 87.2880 & 9.3428 & 0.9759 \\ \hline Testing error (generalization performance) & 750.0399 & 27.3868 & 0.7173 \\ \hline \hline \end{tabular}
\end{table} 
Table 13: The performance of the optimal CART model. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Performance** & **MSE** & **RMSE** & \(R^{2}\) \\ \hline \multirow{3}{*}{KNN} & Before tuning & 1138.5934 & 33.7430 & 0.5709 \\ \cline{2-4}  & After tuning & 762.1359 & 27.6068 & 0.7128 \\ \hline \multirow{3}{*}{CART} & Before tuning & 750.0399 & 27.3868 & 0.7173 \\ \cline{2-4}  & After tuning & 750.0399 & 27.3868 & 0.7173 \\ \hline \multirow{3}{*}{RF} & Before tuning & 742.6653 & 27.2518 & 0.7201 \\ \cline{2-4}  & After tuning & 728.9268 & 26.9986 & 0.7253 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Results of hyperparameter tuning using KNN, CART, and RF. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model Performance** & **MSE** & **RMSE** & \(R^{2}\) \\ \hline Training error & 77.8977 & 8.8259 & 0.9785 \\ \hline Testing error (generalization performance) & 762.1359 & 27.6068 & 0.7128 \\ \hline \hline \end{tabular}
\end{table} 
Table 12: The performance of the optimal KNN model. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Hyperparameter** & **Value of Hyperparameter** \\ \hline \multirow{3}{*}{KNN} & Distance metric & Manhattan distance \\ \cline{2-4}  & The value of k & 5 \\ \cline{2-4}  & Distance weighting & weighting by the inverse of \\ \cline{2-4}  & Splitting criterion & mean absolute error criterion \\ \cline{2-4}  & The size of tree & 17 \\ \cline{2-4}  & Minimum node size & 2 \\ \hline \multirow{3}{*}{RF} & The number of trees & 200 \\ \cline{2-4}  & The size of the random subset of features & the square root of the number \\ \cline{2-4}  & Splitting criterion & mean squared error criterion \\ \cline{2-4}  & The size of the tree & 16 \\ \cline{2-4}  & Minimum node size & 2 \\ \hline \hline \end{tabular}
\end{table} 
Table 11: The best hyperparameter combinations of KNN, CART, and RF. Table 14 shows that the best RF model performed well on the training set; however, the generalization performance of the best RF model was not as good as the performance on the training set. Therefore, it suffered from overfitting. However, it cannot be denied that the best RF model achieved a good \(R^{2}\) score of 0.7253. Overall, Table 14 shows that the optimal RF model performed best and with the slightest overfitting among those optimal models, and the rankings of MSE, RMSE, and \(R^{2}\) in Table 15 identically show that the optimal RF model was in the first position and was the top performing learning algorithm, as we expected at first. After all, ensemble learning is often considered to be more robust than a single base learner in practice [16]. Therefore, we choose it to be the final predictive model for plaintiffs, defendants, and lawypers, serving as a robust tool to predict the potential outcomes of judgments regarding discretionary damages of mental suffering in fatal car accident cases.