# Extension of DBSCAN in Online Clustering: An Approach Based on Three-Layer Granular Models
## 5 Experiment and Discussion
### Synthetic Data
#### 5.1.3 Online Testing and Evaluation  
According to the description in Section 4.3, the online testing is actually a rule-based clustering process. It is to determine the belonging clusters of testing data based on rules. Since the proposed approach considers DBSCAN and GrC in rule formation, it of course inherits the ability of density-based methods on distinguishing arbitrarily-shaped clusters. However, the rule-based clustering is superior to density-based clustering on reducing the cost of online clustering. For example, the crispy DBSCAN algorithm has to test all core points when clustering new incremental data, but the proposed approach can make decisions by just the constructed rules. Based on Equation (16), 1000 new data points are generated as the testing dataset, which contains 500 points in Cluster 1 and 500 points in Cluster 2, respectively. The concrete online clustering of the proposed method is described in Figure 4. It is known that the final result could be calculated by rules of both \(R_{i}\) and \(\overline{R}_{i}\), and it can be fuzzy or determined according to the application requirement. In this paper, we just consider the rule, R\({}_{i}\), to obtain a certain cluster label. To evaluate the performance of clustering the new incremental dataset quantitatively, the accuracy metric can be given out in (23):  
\[Acc=\frac{1}{N}{\sum_{i=1}^{nc}TP_{i}}\times 100\% \tag{23}\]  
where \(Acc\) is the accuracy; \(nc\) is the amount of clusters; \(N\) is the total amount of samples for testing; and \(TP\) represents true positive event via the confusion matrix [48], i.e., it calculates the amount of correctly-clustered data points. Table 3 shows the performance of the proposed approach in online clustering, including the accuracy and computation time. Because different numbers of granules have different influences on the specificity of rules in medium space (as shown in Figures 8 and 9), this subsequently affects the final online clustering performance. Therefore, four different parameters are discussed here: \(c\) = 5, 10, 15, 20. From the above results, it is found that as the number of granules increase, the accuracy of online clustering improves, but the computation cost will also increase. Therefore, there should be a trade-off for the final selection in practical applications. To further compare the performance of the proposed approach with other DBSCAN extensions on online clustering, as well as other well-known online clustering methods, four methods are selected here, such as crispy incremental DBSCAN (C-DBSCAN), incremental grid-DBSCAN algorithm (G-DBSCAN), online \(k\)-means, and online weighted \(k\)-means (W-\(k\)-means) [49]. Table 4 shows the comparison results of different online clustering methods on the given toy data. The proposed approach is set up with \(c\) = 20 for the sake of good performance. By comparing with the other two DBSCAN extensions, which also have the same number of cells for online clustering, it is found that the major superiority of the proposed approach is less time consuming, even though it also has a slightly better online clustering performance than other two. In this way, it is not difficult to understand that the proposed method would achieve bigger superiority on online clustering overhead when dealing with a larger size of data in big data analysis. On the other hand, by comparing results of the proposed method with that of two well-known online clustering methods, it is found that the proposed method has no superiority on computation time, since \(k\)-means and its extensions can use cluster centers to guide online clustering fast, whereas the proposed \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \(c\) = 5 & \(c\) = 10 & \(c\) = 15 & \(c\) = 20 \\ \hline Acc. & 0.8920 & 0.9350 & 0.9400 & 0.9520 \\ \hline Time & 0.0316 & 0.0438 & 0.0908 & 0.0927 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Performance of the proposed approach in online clustering. method can obviously outperform \(k\)-means extensions on the accuracy performance.