## 3 Results  
The Nyquist plot and the dependence of the impedance module and impedance phase shift on frequency--for 60 results (20 patients times 3 positions: \(-\)45, 0, and 45 degrees)--are shown in Figures 5 and 6, respectively. Both the impedance values and the shape of the curves for the measurements labeled as injured seem to be different from those for the measurements labeled as non-injured. On this basis, it can be expected that the use of machine learning algorithms to classify these two cases using the calculated features will be characterized by high accuracy. The summary (including accuracy, sensitivity, and specificity metrics) of the classification (based on the machine learning model with impedance data as inputs) of the OASI classification (\(\leq\)2 vs. \(>\)2) and the Wexner scale (=0 vs. \(>\)0), for raw data and the data re-analyzed with the SMOTE algorithm, are summarized in the Tables 10 and 11, respectively. Figure 5: The Nyquist plot presenting the dependence between the resistive and capacitive (reactance) components of the impedance measured for all patients for the probe positioned at \(-\)45, 0, and 45 degrees. The results for patients with OASI classification greater than 2 are marked in red, while the results of patients with a score of 2 or less are marked in blue. The ROC (Receiver Operating Characteristic) curves for two outputs, OASI classification and Wexner scale, are presented in Figures 7 and 8, respectively. They take into account two considered classification models (k-NN and RF), and two datasets (raw and re-analyzed). \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Output** & \multicolumn{2}{c}{**OASI Classification**} & \multicolumn{2}{c}{**Wexner Scale**} \\ \cline{2-5}
**Method** & **k-NN** & **RF** & **k-NN** & **RF** \\ \hline Accuracy (\%) & 91.0 & **93.3** & 77.7 & **79.8** \\ Sensitivity (\%) & **83.3** & 66.7 & **74.3** & 46.0 \\ Specificity (\%) & 91.5 & **94.7** & 78.3 & **86.0** \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Summary of the classification (based on the machine learning model with impedance data as inputs) of the OASI classification and Wexner scale, based on the data re-analyzed with the SMOTE algorithm; k-NN: k-Nearest Neighbors; RF: Random Forests; all metrics (accuracy, sensitivity, and specificity) were calculated from confusion tables gathered during analysis (10-fold hold-out cross-validation). Figure 6: Three-dimensional graph of the phase shift dependence on the impedance module and whole measurement frequency range of all patients for the probe positioned at \(-45\), 0, and 45 degrees. The color details are the same as for Figure 5.  
As expected, the sensitivities for raw data are lower (particularly for the Random Forest algorithm and for the Wexner scale), as the raw dataset is imbalanced (there are many more results with non-injured than with injured labels), along with the fact that the raw dataset has a low number of samples (obtained from only 20 patients). In terms of accuracy, the Random Forest algorithm performed better for both OASI classification and Wexner scale, but k-Nearest Neighbors (k-NN) had greater sensitivities in those cases. Considering the re-analyzed dataset, both machine learning algorithms yielded over 97% accuracy for OASI classification. The sensitivities are significantly larger (which would be crucial for any screening method). The highest specificity was for the Random Forest technique and was equal to 99.8%. It is worth mentioning that each measure of performance was over 99% for the Random Forest method. For the Wexner scale in turn, the highest  
Figure 8: The ROC curve estimated for the Wexner scale, considering two classification models and two datasets. Figure 7: The ROC curve estimated for the OASI classification, considering two classification models and two datasets. accuracy and specificity were obtained with the Random Forest method and were equal to 97.0% and 95.3%, respectively. The k-Nearest Neighbors algorithm yielded the highest sensitivities, which were flawless.