# Predicting Software Cohesion Metrics with Machine Learning Techniques
## 4 Results and Discussion
\begin{table}
\begin{tabular}{l c c c c c c} \hline \hline  & \multicolumn{3}{c}{**Dataset\#1**} & \multicolumn{3}{c}{**Dataset\#2**} \\ \hline  & **R** & **MAE** & **RMSE** & **R** & **MAE** & **RMSE** \\ \hline REPTree & 0.681 & 5.245 & 9.677 & 0.892 & 9.348 & 17.259 \\ \hline RF & 0.665 & 5.272 & 10.057 & 0.873 & 9.584 & 18.813 \\ \hline KNN & 0.709 & 5.080 & 9.304 & 0.895 & 9.398 & 17.025 \\ \hline LR & 0.607 & 5.989 & 10.470 & 0.861 & 12.662 & 19.440 \\ \hline MLP & 0.603 & 6.841 & 10.653 & 0.868 & 12.346 & 19.107 \\ \hline SVM & 0.601 & 5.886 & 10.542 & 0.860 & 12.125 & 20.182 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Regression analysis results for the LCOM2 metric after outliers and extreme values were removed. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline  & \multicolumn{3}{c}{**Dataset\#1**} & \multicolumn{3}{c}{**Dataset\#2**} \\ \hline  & **R** & **MAE** & **RMSE** & **R** & **MAE** & **RMSE** \\ \hline REPTree & 0.681 & 0.082 & 0.151 & 0.892 & 0.048 & 0.090 \\ \hline RF & 0.665 & 0.082 & 0.157 & 0.873 & 0.049 & 0.098 \\ \hline KNN & 0.709 & 0.079 & 0.145 & 0.895 & 0.048 & 0.088 \\ \hline LR & 0.607 & 0.094 & 0.164 & 0.861 & 0.065 & 0.101 \\ \hline MLP & 0.603 & 0.107 & 0.167 & 0.868 & 0.064 & 0.099 \\ \hline SVM & 0.601 & 0.092 & 0.165 & 0.860 & 0.063 & 0.105 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Regression analysis results for the normalized LCOM2 metric after removing outliers and extreme values. For the normalized LCOM2 metric, the highest correlation and lowest error values were obtained with the KNN algorithm. The best values for the KNN algorithm were obtained at k = 9. The correlation coefficients were the same as the values given in Table 2. Compared with the data shown in Tables 1 and 2, the reason for the large reduction in error rates was that the LCOM2 value was normalized between 0 and 1. For the remaining metrics, there was no need to apply normalization since these metrics were already between 0 and 1. The regression analysis results obtained for the TCC metric are provided in Table 4. The highest correlation coefficient and the lowest error values were obtained with the KNN algorithm at k = 13. According to the Table 5 regression analysis results obtained for the LCC metric. The highest correlation and lowest error values were obtained with the REPTree algorithm. The highest correlation and lowest error values for the KNN algorithm were obtained at k = 5. When the data in Table 6 for the LSCC metric were examined, the highest correlation and lowest error values were obtained with the REPTree technique. The highest correlation and lowest error values for the KNN algorithm were obtained at k = 5. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline  & \multicolumn{3}{c}{**Dataset#1**} & \multicolumn{3}{c}{**Dataset#2**} \\ \hline  & **R** & **MAE** & **RMSE** & **R** & **MAE** & **RMSE** \\ \hline REPTree & 0.762 & 0.149 & 0.232 & 0.896 & 0.097 & 0.178 \\ \hline RF & 0.757 & 0.151 & 0.235 & 0.894 & 0.097 & 0.179 \\ \hline KNN & 0.753 & 0.152 & 0.236 & 0.887 & 0.100 & 0.185 \\ \hline LR & 0.382 & 0.270 & 0.331 & 0.487 & 0.303 & 0.351 \\ \hline MLP & 0.631 & 0.223 & 0.294 & 0.748 & 0.204 & 0.278 \\ \hline SVM & 0.358 & 0.248 & 0.369 & 0.484 & 0.274 & 0.403 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Regression analysis results for the LSCC metric. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline  & \multicolumn{3}{c}{**Dataset#1**} & \multicolumn{3}{c}{**Dataset#2**} \\ \hline  & **R** & **MAE** & **RMSE** & **R** & **MAE** & **RMSE** \\ \hline REPTree & 0.632 & 0.234 & 0.319 & 0.579 & 0.201 & 0.280 \\ \hline RF & 0.601 & 0.238 & 0.332 & 0.543 & 0.209 & 0.292 \\ \hline KNN & 0.640 & 0.231 & 0.317 & 0.586 & 0.203 & 0.278 \\ \hline LR & 0.217 & 0.362 & 0.401 & 0.147 & 0.282 & 0.340 \\ \hline MLP & 0.279 & 0.354 & 0.409 & 0.160 & 0.293 & 0.352 \\ \hline SVM & 0.208 & 0.361 & 0.409 & 0.117 & 0.267 & 0.382 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Regression analysis results for the TCC metric.