# Time Series Clustering of Online Gambling Activities for Addicted Users' Detection
## 4 Results and Discussion
### Black Jack  
The result discussed in this section were obtained with the procedure presented before. Thus, the elbow method and the silhouette score were used to select the optimal value for \(k\), and subsequently, the k-means algorithm was executed. The elbow method suggests that the possible optimal values for \(k\) are three or four, as shown in Figure 13. The silhouette score was then calculated for these two values, obtaining a value of \(0.66\) for \(k=3\) and a value of \(0.693\) for \(k=4\). These two values are both positive and relatively high, indicating that the clustering configuration is good in both cases. However, the value for \(k=4\) turns out to be slightly higher, making it preferable to the value of \(k=3\). After applying the algorithm, we obtained four clusters with the following number of observations:  
* Cluster 0: 4575
* Cluster 1: 415
* Cluster 2: 174
* Cluster 3: 13  
Figure 12: Time series plot of two potential medium-risk pathological gamblers. Figure 14 shows the analogous box plots presented in the previous section, for the results related to black jack. Figure 14: _Cont_. Figure 13: Elbow method plot on black jack data using the time series \(k\)-means. The first thing we can notice is that the number of placed bets in each cluster is much greater than in sports bets' data. This is certainly due to the type of game being considered. Another consequence that derives from the considered type of game is the amount spent: black jack is a game that requires a greater economic availability even just to make a limited number of bets (as confirmed by Figures 15 and 16). We can also note that the number of placed bets in Clusters 2 and 3 is significantly higher than in the other two. Cluster 3 seems to contain gamblers who place many high value bets, losing much money at the end of the month. Cluster 2 seems also to contain gamblers who place many bets; however, the bet amounts are lower than in Cluster 3. Despite this, it is also characterized by a large fraction of gamblers with a negative final balance. Similarly to sports bets' data, we can say that Cluster 0 and Cluster 1 represent respectively occasional and regular players, given the number of placed bets, the amount spent, and the final balance. These indications are confirmed by the histograms presented in Figures 15-17. Figure 17 highlights an interesting fact: only a small percentage of players, in the considered period, achieved a positive final balance. Figure 14: Box plots for black jack bets’ data using the time series \(k\)-means algorithm. Figure 16: Histograms of the total amount spent obtained using the time series _k_-means algorithm. The x axis reports the amount spent, while the y axis shows the number of players that have spent that amount during the month. Figure 15: Histograms of the number of bets obtained using the time series _k_-means algorithm. The x axis reports the number of bets, while the y axis shows the number of players that have performed that amount of bets during the month. Almost all the winning gamblers are concentrated in Clusters 0 and 1. Only a few gamblers in Cluster 2 made a profit, while in Cluster 3, there are no winning gamblers. Furthermore, as happened with the results obtained in sports bets, gamblers who have a positive balance tend to have a low number of placed bets and a low amount spent, as highlighted in Figure 18.  
Given the presented characteristics of Clusters 2 and 3, we can say that Cluster 2 is composed by potential medium-risk pathological gamblers, while Cluster 3 by potential high-risk pathological gamblers. It should be noted that both clusters could contain both pathological and professional gamblers. However, the total absence of players with a positive final balance makes their identification difficult. Figure 17: Histograms of the total balance obtained using the time series \(k\)-means algorithm. The x axis reports the balance, while the y axis shows the number of players that obtained that balance during the month.