## 5 Case Study
### Model Optimization  
In our study, the following settings for the LDA models were used. The maximum number of iterations that the model has to converge was set to be equal to \(T=250\), the implemented optimizer (or inference algorithm used to estimate the LDA model) was selected in a set of four listed below.  
1. cgs--collapsed Gibbs sampling. It can be more accurate at the cost of taking longer to run [26].
2. avb--approximate variational Bayes. It typically runs more quickly than collapsed Gibbs sampling and collapsed variational Bayes, but can be less accurate [41].
3. cvb--collapsed variational Bayes. It can be more accurate than approximate variational Bayes at the cost of taking longer to run [42].
4. savb--stochastic approximate variational Bayes. It is best suited for large datasets [43].  
The possible range of topic value \(K\) was set between a minimum of 5 and a maximum of 40. In our case study, a number equal to 5 was considered the lowest possible number of clusters to divide the corpus in, and 40 was considered an acceptable upper bound, since having more clusters leads to results that are complex to be analyzed and validated. The LDA parameters, \(\alpha\) value, and the \(\beta\) value should be greater than or equal to 0. The value set for this parameter was \(\alpha=50/K\) and the value set for \(\beta\) was \(\beta=0.1\), according to the literature [44].  
The performance metric selected in our study is the \"perplexity\" value. It inversely measures the statistical likelihood that data, in the case study, are generated by the LDA model. Hence, a lower \"perplexity\" indicates a higher likelihood value and better model performance. \"Perplexity\" was computed using the inverse of the geometric mean of token likelihood within the test corpus. Low \"perplexity\" values, in other words, suggest strong consistency between word distributions in test documents and outputs from training topics.  
Figure 6 depicts the \"perplexity\" trend for the four inference algorithms used to estimate the LDA model and for topics number \(K\) ranging between 5 and 40. From Figure 6, it appears that for the cgs, avb and cvb0 optimizer, the \"perplexity\" curves decrease nearly  
Figure 5: The effects of the tf-idf correction on \(A(d_{1:10},w_{1:10})\).  
monotonically with the increase in the number of topics, which demonstrates that LDA can refine the statistical model as more topics are considered. On the other hand, for savb optimizer, the \"perplexity\" does not show a clear decreasing trend with the growth in the number of topics.  
In terms of computational performance, it results that the collapsed variational Bayes approach cvb0, despite presenting the best performance in terms of \"perplexity\" for any number of topics \(K\) ranging between 5 and 40, and also requires the most significant computational time to run, when compared to all the other methods. The plot in Figure 6 also suggests that fitting a model with topics ranging between 20 and 25 may be a good choice. Increasing the number of topics may lead to a better fit, but fitting the model takes longer to converge. Since we also observed from our experimental results the redundancy of topics meaning for large values of \(K\), we decided to set \(K=20\) as the proper choice of topic number for the reference case study.  
From the results graphically reported in Figure 6, and by considering the trade-off between performance measures in terms of \"perplexity\" and computational time, it appears that the CGS-based LDA classification model performs better than the VB-based models. Therefore, the CGS-based LDA classification model results in the most satisfactory approach in our case study.