## 5 Machine Learning Implementation
### Results Discussion  
In the same way as the other tests, the Random Forest algorithm achieves the best results. In the Random Forest algorithm, test (a) stands out from the remaining tests. This test achieves the following accuracy values: 82.1% on the CV, 74.6% on the test data, and 66.1% on the new data. The results indicate that test (a) performed better in characterizing gender and Chest Wall Perimeter (CWP), while test (b) excelled in age and Body Mass Index (BMI) characterization. A parallel study examined the impact of reducing correlation to 0.5, but this did not enhance the results.  
When applied to new data, the results were lower than those obtained in cross-validation and with test subjects, which is expected as these subjects were previously unknown to the algorithm. CWP was the easiest to classify, achieving the highest accuracy of 66.11% with new subjects. This could be due to the Bio-Radar system's direct measurement of chest wall displacement in individuals with higher CWP. Conversely, age was the hardest to classify, with the lowest accuracy of 55.78% for new subjects. This could be because certain characteristics become more pronounced with age.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & **Parameters** & \begin{tabular}{c} **(a)** \\ **Acc \(\pm\) STD [\%]** \\ \end{tabular} & \
\begin{tabular}{c} **(b)** \\ **Acc \(\pm\) STD [\%]** \\ \end{tabular} \\ \hline \multirow{3}{*}{SVM} & CV & 71.3 \(\pm\) 2.2 & 72.7 \(\pm\) 2.2 \\  & Test & **71.4 \(\pm\) 2.9** & 71.0 \(\pm\) 2.4 \\  & New Data & 56.7 \(\pm\) 23.7 & 55.2 \(\pm\) 14.5 \\ \hline \multirow{3}{*}{KNN} & CV & 71.3 \(\pm\) 1.5 & 71.3 \(\pm\) 1.5 \\  & Test & 72.3 \(\pm\) 2.8 & **72.5 \(\pm\) 2.2** \\  & New Data & 55.0 \(\pm\) 21.7 & 51.7 \(\pm\) 12.5 \\ \hline \multirow{3}{*}{
\begin{tabular}{c} Random \\ Forest \\ \end{tabular} } & CV & 80.8 \(\pm\) 0.8 & 80.6 \(\pm\) 0.5 \\  & Test & 70.6 \(\pm\) 3.1 & **72.5 \(\pm\) 1.4** \\ \cline{1-1}  & New Data & 59.2 \(\pm\) 23.0 & 56.7 \(\pm\) 11.3 \\ \hline \hline \end{tabular}  
* Acc—Accuracy; CV—Cross-Validation; STD—Standard Deviation. (a)—Correlation = 0.7 and new subjects = 2; (b)—Correlation = 0.7, new subjects = 5.  
\end{table}
Table 8: ML results for the BMI test.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & **Parameters** & \
\begin{tabular}{c} **(a)** \\ **Acc \(\pm\) STD [\%]** \\ \end{tabular} &
\begin{tabular}{c} **(b)** \\ **Acc \(\pm\) STD [\%]** \\ \end{tabular} \\ \hline \multirow{3}{*}{SVM} & CV & 76.4 \(\pm\) 2.0 & 75.3 \(\pm\) 2.2 \\  & Test & 76.4 \(\pm\) 2.3 & **76.8 \(\pm\) 2.2** \\  & New Data & 59.2 \(\pm\) 18.9 & 57.1 \(\pm\) 16.3 \\ \hline \multirow{3}{*}{KNN} & CV & 75.3 \(\pm\) 1.5 & 75.4 \(\pm\) 1.8 \\  & Test & **75.8 \(\pm\) 3.1** & 75.6 \(\pm\) 2.8 \\  & New Data & 51.7 \(\pm\) 17.9 & 54.0 \(\pm\) 11.1 \\ \hline \hline \end{tabular}  
* Acc—Accuracy; CV—Cross-Validation; STD—Standard Deviation. (a)—Correlation = 0.7 and new subjects = 2; (b)—Correlation = 0.7, new subjects = 5.  
\end{table}
Table 9: ML results for the CWP test.  
The respiratory signal features from both tests suggest the possibility of distinguishing between different classification groups in all binary tests. The accuracy results from cross-validation and the hold-out test are mostly similar, indicating the model's robustness.  
Adjusting the number of new subjects showed that better results correspond to a larger number of people for testing and training. However, the values achieved with test (b) did not significantly differ from those obtained with test (a), consistently remaining above 50% in all tests. These findings indicate that the dataset of 90 individuals may not be fully representative of the overall population. Nonetheless, the results achieved with the test population, reaching around 70%, suggest the possibility of successfully distinguishing the classes within this specific population.