## 4 Machine Learning Algorithms
### Random Forest Algorithm Development
#### 4.1.2 Regression Algorithm  
Another way to utilize a machine learning algorithm in an NDE is by developing a regression algorithm. Unlike the classification algorithm described earlier, which predicts discrete targets, a regression algorithm predicts continuous target values. Additionally, a regression algorithm can be more precise by forecasting the exact values of targets that fall within the boundaries of two distinct classes. This makes the predicted targets more concrete in numerical terms. The regression algorithm incorporates nine types of attributes based on the data set. These attributes have varying functions in the process and can be classified as Features, Meta, or Target, as explained below:  
Figure 12: Confusion matrix for the number of instances: (**a**) for the HCP; (**b**) for ER.  
\begin{table}
\begin{tabular}{|c|c c c c c c|} \cline{2-7} \multicolumn{1}{c}{} & Target Class & Model & AUC & CA & F1 & Precision & Recall \\ \hline \multirow{4}{*}{HCP} & Negligible & Random Forest & 0.991 & 0.966 & 0.932 & 0.897 & 0.971 \\ \cline{2-7}  & Weak & Random Forest & 0.993 & 0.986 & 0.954 & 0.984 & 0.926 \\ \cline{2-7}  & Moderate & Random Forest & 0.978 & 0.947 & 0.827 & 0.848 & 0.807 \\ \cline{2-7}  & High & Random Forest & 0.990 & 0.953 & 0.947 & 0.951 & 0.944 \\ \cline{2-7}  & Average Over Classes & Random Forest & 0.989 & 0.926 & 0.926 & 0.927 & 0.926 \\ \hline \multirow{4}{*}{HCP} & No Corrosion & Random Forest & 0.979 & 0.931 & 0.837 & 0.808 & 0.867 \\ \cline{2-7}  & Transition & Random Forest & 0.894 & 0.879 & 0.596 & 0.688 & 0.525 \\ \cline{2-7}  & Corrosion & Random Forest & 0.971 & 0.907 & 0.928 & 0.910 & 0.946 \\ \cline{2-7}  & Average Over Classes & Random Forest & 0.953 & 0.859 & 0.853 & 0.851 & 0.859 \\ \hline \end{tabular}
\end{table}
Table 3: Evaluation results.  
The regression algorithm was evaluated for both ER and the HCP, and the results show that the coefficient of determination (R\({}^{2}\)) for ER was 0.861, indicating a strong positive relationship between the predicted and actual results, with a CVMSM of 69.388. The R\({}^{2}\) for the HCP was 0.841, also indicating a strong positive correlation with a CVMSM of 16.267.  
Figure 14a,b display the correlations between actual instances (on the \(x\)-axis) and Random Forest predictions (on the \(y\)-axis) for ER and the HCP, respectively. The correlations are shown in three different colors: blue for no delamination, red for AFD, and green for WFD. In the case of ER, red instances have the highest correlation r value of 0.94, with 0.93, 0.90, and 0.92 for blue instances, green instances, and overall instances, respectively. This indicates that the regression algorithm is the most accurate when ER technology is applied on concrete slabs with AFD and the least accurate on those with WFD. On the contrary, HCP technology has a higher correlation value of r equal to 0.94 for blue instances. Conversely, the other correlation values are 0.87, 0.92, and 0.91 for red, green, and overall instances, respectively. Thus, the regression algorithm's prediction is most accurate when HCP technology is applied to sound concrete, but its accuracy decreases in the presence of WFD. The lowest accuracy occurs when AFD is present.  
Figure 13: Workflow diagram for the HCP and ER regression algorithm.