# Data Mining Techniques for Endometriosis Detection in a Data-Scarce Medical Dataset
## 2 Materials and Methods
### Dataset from Multiple Sample Types
## 3 Results

It is worth noting that if a random classifier [47] from Table 13 was considered, the accuracy and the F1 score were \(\frac{10}{16}\) (62.5%) and \(\frac{3}{12}\) (25%) in the oral region, respectively. Equations (7)-(10) prove the previous figures. \[ \begin{split}\mathbb{P}[EM]=\frac{3}{12}&\mathbb{P}[ Success\ EM]=\frac{3}{12}\\ \mathbb{P}[Non\ EM]=\frac{9}{12}&\mathbb{P}[ Success\ Non\ EM]=\frac{9}{12}\end{split}  \tag{7}\]

\[Accuracy=\mathbb{P}[Success]=\mathbb{P}[Success\ EM]\times\mathbb{P}[EM]+ \mathbb{P}[Success\ Non\ EM]\times\mathbb{P}[Non\ EM] \tag{8}\]

\[Accuracy=\frac{3}{12}\times\frac{3}{12}+\frac{9}{12}\times\frac{9}{12}=( \frac{1}{4})^{2}+(\frac{3}{4})^{2}=\frac{10}{16} \tag{9}\]

\[Accuracy=\frac{10}{16}\hskip 56.905512 ptF1=\mathbb{P}[EM]=\frac{3}{12} \tag{10}\]In the fecal sample type, the accuracy and the F1 score were \(\frac{97}{169}\) (57.4%) and \(\frac{4}{13}\) (30.8%), respectively. Equations (11) and (12) prove the previous figures. \[ \begin{split}\mathbbm{P}[EM]=\frac{4}{13}&\qquad \qquad\qquad\qquad\qquad\mathbbm{P}[Success\ EM]=\frac{4}{13}\\ \mathbbm{P}[Non\ EM]=\frac{9}{13}&\qquad \qquad\qquad\mathbbm{P}[Success\ Non\ EM]=\frac{4}{13}\end{split}  \tag{11}\]

\[Accuracy=\frac{4}{13}\times\frac{4}{13}+\frac{9}{13}\times\frac{9}{13}=( \frac{4}{13})^{2}+(\frac{9}{13})^{2}=\frac{97}{169}\quad\quad F1=\mathbbm{P}[ EM]=\frac{4}{13} \tag{12}\]

In the other regions, the accuracy and the F1 score were \(\frac{5}{9}\) (55.6%) and \(\frac{1}{3}\) (33.3%), respectively. See Equations (13) and (14). \[ \begin{split}\mathbbm{P}[EM]=\frac{7}{21}&\qquad \qquad\qquad\qquad\qquad\mathbbm{P}[Success\ EM]=\frac{7}{21}\\ \mathbbm{P}[Non\ EM]=\frac{14}{21}&\qquad \qquad\qquad\mathbbm{P}[Success\ Non\ EM]=\frac{14}{21}\end{split}  \tag{13}\]

\[Accuracy=\frac{7}{21}\times\frac{7}{21}+\frac{14}{21}\times\frac{14}{21}=( \frac{7}{21})^{2}+(\frac{14}{21})^{2}=\frac{245}{441}=\frac{5}{9}\qquad \qquad\qquad F1=\mathbbm{P}[EM]=\frac{7}{21}=\frac{1}{3} \tag{14}\]

As a result, we can see that the random classifier performed poorly in all regions. Thus, we recommend using models that reach at least these performance thresholds. Considering the number of folds of cross-validation and the number of repetitions (100), the classifier was trained a total of 300 times in the oral and fecal regions and 700 times in the other regions. Nevertheless, only classifiers not presenting zero division were considered for obtaining the statistics and are reported in the corresponding tables. As mentioned in Section 2.4, the F1 score was used to compare the performance of the different machine learning classifiers. Next, the best classifiers obtained for each model--logistic regression, decision tree, SVM linear, and SVM rbf--after the grid search are presented and analyzed. ### Logistic Regression Classification

The main parameters for this classification are shown in Table 15. Table 16 summarizes the main findings of this experiment using these parameters. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Name** & **Value** & **Description** \\ \hline Classifier & LogisticRegression & Python classifier from sklearn.linear\_model \\ solver & liblinear & Algorithm to use in optimization problem \\ max\_iter & 1,000,000 & Maximum number of iterations \\ C & 1.0 & Inverse of regularization strength \\ n\_repeats & 100 & Number of repetitions in RepeatedKFold \\ \hline \hline \end{tabular}
\end{table} 
Table 15: The parameters for the logistic regression classification model. As shown in Table 16, the F1-score of the random classifiers for the EB, EF, and vaginal samples did not exceed the minimum threshold of 33.33% given by Equation (12). The F1 scores for the oral and fecal samples were 74.77% and 49.72%, respectively. GIT sample types were higher than the minimum thresholds of the random classifier, which were 25% for oral samples and 30.8% for fecal samples. These results validated the initial hypothesis that the classification of the oral and fecal sample types is better than in the reproductive region.