# A Clustering Algorithm for Evolving Data Streams Using Temporal Spatial Hyper Cube
## 3 Methodology
### Developed Algorithms
#### 3.4.4 BOCEDS Micro-Cluster Update
The lower performance obtained in LandSat is by the nature of data that is less dynamic and did not need a buffer. Structuring and detecting the different clusters is more from a density perspective which has enabled MuDi to get better performance. #### 4.1.3 Adjusted Rand Index (ARI)

The adjusted rand index (ARI) is a development of the rand index (RI). It is recommended as the index of choice when comparing two partitions in a clustering analysis with a variable number of clusters. The adjusted rand index (ARI) is defined as the following:

\[ARI=\frac{\binom{n}{2}(|TP|+|TN|)-[(|TP|+|FN|)(|TP|+|FP|)+(|Fp|+|TN|)(|FN|+|TN|)]}{ \binom{n}{2}^{2}-[(|TP|+|FN|)(|TP|+|FP|)+(|FP|+|TN|)(|FN|+|TN|)]} \tag{11}\]

Generally, an ARI value ranges from 0 to 1. The index value is 1 only if a partition is identical to the intrinsic structure, and it is close to 0 if the partition is random. ARI is utilized in a variety of research to evaluate data stream clusterings [16; 29; 30]. The adjusted rand index for the various datasets is illustrated in Figure 6. As presented in the figure, the median of ARI for TSHC in DNA, spiral, and Landsat datasets were 0.22, 0.1, 8, and 0.08 which is higher than BOCEDS, BOCEDS Inc., CEDAS, and MuDiStream, respectively. The values of ARI were almost zeros for LandSat due to the nature of this data which has a highly non-organized structure and makes it difficult to be partitioned into groups based on a non-supervised algorithm. Figure 5: Rand Index Comparison Using KDDCup’99, Landsat, Spiral, and DNA Datasets. #### 4.1.4 Normalized Mutual Information (NMI)

The normalized mutual information (NMI) is a well-known information-theoretic statistic that indicates the degree of similarity between two clusterings. Indeed, to make a trade-off between clustering quality and clustering density. NMI can also be used when the number of classes is not equal to the number of clusters. NMI(\(C\), \(G\)) is defined as the normalized mutual information:

\[\text{NMI}(C,G)=\frac{\sum_{i}\sum_{j}\frac{n_{ij}}{n}\log\frac{n*n_{ij}}{a_{i} *b_{j}}}{\sqrt{\sum_{i}a_{i}*\log\left(\frac{a_{i}}{n}\right)*\sum_{j}b_{j}* \log\left(\frac{b_{j}}{n}\right)}} \tag{12}\]

Normalized mutual information is a measurement for determining the quality of clustering. It reaches its maximum value of 1 only when the two sets of labels correspond perfectly. NMI has been used to evaluate data stream clustering in a variety of research [14, 15, 23, 31]. In Figure 7, the findings of normalized mutual information are provided for the multiple datasets. As illustrated in the figure, TSHC has accomplished high values for a median of NMI, nearly 0.32 for both DNA datasets which were superior to the benchmark, and a median close to 0.29 for the Spiral dataset, which is higher than the benchmark of BOCEDS, BOCEDS Inc., CEDAS and MuDi-Stream. The only two datasets that caused an inferior performance of TSHC are Landsat and KDD. Similarly, all algorithms have failed in providing good NMI for LandSat which is interpreted by the nature of the data. \[ADR=\frac{CAS}{Total\ Anomaly\ Samples} \tag{9}\]0 Adjusted Rand Index Comparison Using KDDCup’99, Landsat, Spiral, and DNA Datasets. ### Efficiency Evaluation

The efficiency evaluation is used for evaluating the efficiency of the developed BOCDES TSHC-ATI-SD algorithm, which includes memory usage and computational cost, which is performed using four different datasets as given below:

#### 4.2.1 Memory Usage

The memory usage is calculated based on the number of core-mini clusters generated from each of the algorithms. As given in Figure 8, it is found that CEDAS and MuDi-Stream were the most in terms of memory usage compared with the other algorithms including ours and BOCEDS. This applies to all datasets. Another observation is that CEDAS has generated a higher value of memory usage compared with MuDi-Stream. This shows that adding extra buffer clusters to CEDAS is effective in reducing its original memory usage and making it efficient in terms of memory such as BOCEDS, BOCEDS Inc., and TSHC.