# Predictive Fraud Analysis Applying the Fraud Triangle Theory through Data Mining Techniques
## 4 Results and Discussion
### Probability Distribution Generation
#### 4.1.1 Optimal Number of Topics  
When topic modeling is used, it is essential to determine the number of topics (\(k\)) that best capture the trends in potentially fraudulent messages. We constructed several models based on LSA, NMF, and LDA with different values of \(k\), and those with the highest coherence score were selected. Choosing several \(k\) topics associated with the maximum resulting coherence generally offers the most appropriate topics.  
To obtain the coherence value of different models, scikit-learn and gensim Python libraries were used. Gensim does not have an implementation of NMF, so it was used only to implement LDA and LSA. scikit-learn offers a solution for NMF, allowing it to obtain the required coherence value.  
The coherence validation for the different numbers of topics is shown in Figure 4. In the three models (LSA, NMF, and LDA), we can observe that the coherence value increases as the number of topics increases, demonstrating that the patterns in data are better captured with a higher number of topics. For the three models, the coherence value gradually increases to a certain \(k\). For LSA, we obtained the highest coherence value when \(k=4\). For NMF, \(k=8\) resulted in a coherence value of 0.9143. LDA obtained the highest coherence value (0.6164) for \(k=9\). For higher values of \(k\), for all three cases, coherence fluctuates indeterminately. This result implies that establishing a higher number of topics does not necessarily imply better performance. Instead, the time necessary for their calculation increases.  
Figure 4: Comparing the techniques (LSA, NMF and LDA)—highest coherence score.  
NMF showed the highest coherence score, followed by LDA and LSA, respectively. NMF classified large numbers of phrases on a specific topic. On the other hand, LDA was able to better distribute phrases along with all 9 topics, according to Table 1.  
To analyze the behavior in the distribution of the topics, based on the values of \(k\) we tested, Tables 2-4 show the 10 most relevant keywords of the analyzed models associated with their related topic. Four topics were discovered using LSA, and some of the words grouped in topics overlap; this is because the dimension of latent themes depends on the range of the corresponding matrix (see Section 2), and this limit is exceeded. Additionally, LSA cannot capture the different meanings of words, offering less precision when distributing words in each topic. Table 2 depicts how words are clustered into topics (context) when using LSA and illustrates how some words are repeated for some topics, which is evidence of the problem of capturing the meaning of words. We use words in color to visually represent this phenomenon.  
In the case of NMF, the overlapping of words along topics is also evident, as depicted in Table 3. Since more topics are involved with NMF, the repetition of words would have a less negative impact than with LSA. Note that the repetition of words may also be due to a too high value of \(k\).  
Finally, as shown in Table 4, the LDA model best groups words in topics since none of such words are repeated; this might entail a more consistent distribution of words along topics.  
Since LDA behaves better on topic modeling in this particular context, we next evaluate this algorithm to detect potential fraud activities.