# An Explainable Artificial Intelligence Approach for Detecting Empathy in Textual Communication
## 6 Results and Discussion
### Classification Results
This meant that we also rejected the null-hypothesis of the test. The average ranks obtained can be seen in Table 8. In this case, we see that RF is the algorithm with the highest rank. Since PBC4 cip was not the highest rank, we decided to carry out an NxN post-hoc test. We made use of the Bergmann-Hommel procedure. In an NxN Friedman test, the hypotheses are logically interrelated; thus, not all combinations of true and false hypotheses are possible [100]. The Bergmann-Hommel procedure is based on the idea of finding all elementary hypotheses which cannot be rejected [99]. The hypothesis rejected do not belong to such group [101]. The adjusted \(p\)-values resulting from the test can be seen in Table 9.  
The procedure rejects the hypotheses of equality between RF vs. GNB, PBC4 cip vs. GNB, and MLP vs. GNB, with a significance level of 0.05. This supported the behavior seen in the test using the AUC metric. While not as direct, we see that PBC4 cip, RF, and MLP are at least not equivalent to the worst performing algorithm. They present the three best rankings, and present no difference among themselves. With these factors in mind, we can say that these algorithms are the ones that present the best performance. PBC4 cip does not present a significant difference between the following algorithms: RF, MLP, KNN, and DT. However, it does present one between it and the worst performing algorithm: GNB. \begin{table}
\begin{tabular}{c c} \hline \hline
**Algorithm** & **Ranking** \\ \hline PBC4 cip & 1.4 \\ RF & 2.2 \\ KNN & 5 \\ GNB & 5 \\ DTC & 5 \\ MLP & 2.4 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Average Rankings of the algorithms (AUC). \begin{table}
\begin{tabular}{c c c} \hline \hline
**i** & **Algorithm** & **Unadjusted \(p\)** & \(p\)**_Finner_ \\ \hline
1 & KNN & 0.002346 & 0.011674 \\
2 & GNB & 0.002346 & 0.011674 \\
3 & DTC & 0.002346 & 0.011674 \\
4 & MLP & 0.398025 & 0.469759\% \\ midrule 5 & RF & 0.498962 & 0.498962 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Unadjusted and Adjusted \(p\)-value for the post-hoc analysis (AUC). \begin{table}
\begin{tabular}{c c} \hline \hline
**Algorithm** & **Ranking** \\ \hline PBC4 cip & 2.2 \\ RF & 1.6 \\ KNN & 4.2 \\ GNB & 6 \\ DT & 4.2 \\ MLP & 2.8 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Average Rankings of the algorithms (CEM). With the results from the statistical tests, we could conclude that the contrast pattern classification algorithm is equivalent to using a Random forest classifier, and a Multi-layer Perceptron classifier when measured by the AUC. Since these algorithms performed significantly better than the rest used in this research, they stand as some of the best performing algorithms when measured by the CEM. In general, the algorithm ranks among the best ones to measure the level of empathy in a conversation. However, PBC4 cip presents another advantage that makes it a superior approach for detecting empathy: the explanatory model. Thanks to the patterns obtained, reasons can be presented as to the nature of the classification. These can provide insight and further knowledge can be obtained regarding empathy. Therefore, we believe PBC4 cip is the best approach for this task, despite the lack of a statistically significant difference between the algorithms with the best performance.