CURE algorithm
CURE is an efficient clustering algorithm for large databases that is more robust to outliers and identifies clusters having non-spherical shapes and wide variances in size.
Drawbacks of traditional algorithms
With the partitional clustering algorithms (say square error criterion $E = \sum_{i=1}^{k} \sum_{p \in C_i} (p-m_i)^{2}$), when there are large differences in sizes or geometries of different clusters, the square error method could split the large clusters to minimize the square error which is not always correct. Also with the heirarchial clustering algorithms these problems exist as none of the distance measures between clusters($d_{min}, d_{mean}$) doesn't tend to work with different shapes of clusters. Also the running time is high when n is very large.The problem with BIRCH is that once the clusters are generated after step 3, we use centroids of the clusters and assign each data point to the cluster with closest centroid. Using only the centroid to redistribute the data has problems when clusters donot have uniform sizes and shapes.
CURE Clustering Algorithm
To avoid the problems with non-uniform sized or shaped clusters,CURE employs a novel heirarchial clustering algorithm that adopts a middle ground between the centroid based and all point extremes. In CURE, a constant number c of well scattered points of a cluster are chosen and they are shrunk towards the centroid of the cluster by a fraction $\alpha$. The scatterd points aftyre shrinking are used as representatives of the cluster. The clusters with the closest pair of representatives are the clusters that are merged at each step of CURE's heirarchial clustering algorithm. This enables CURE to correctly identify the clusters and makes it less sensitive to outliers.
The algorithm is given below.
The running time of the algorithm is O(n^{2}\log n)$ and space complexity is O(n)
The algorithm cannot be directly applied to large databases.So for this purpose we do the following enhancements
Random sampling : To handle large data sets, we do random sampling and draw a sample data set. Generally the random sample fits in main memory. Also because of the random sampling there is a trade off between accuracy and efficiency.
Partitioning for speed up : The basic idea is to partition the sample space into p partitions. Then in the first pass partially cluster each partition until the final number of clusters reduces to \frac{np}{q} for some constant q \ge 1. Then run a second clustering pass on \frac{n}{q} partial clusters for all the partitions. For the second pass we only store the representative points since merge procedure only requires representative points of previous clusters before computing the new representative points for the merged cluster. The advantage of partitioning the input is that we can reduce the execution times.
Labeling data on disk : Since we only have representative points for k clusters, the remaining data points should also be assigned to the clusters. For this a fraction of randomly selected representative points for each of the k clusters is chosen and data point is assigned to the cluster containing the representative point closest to it.
Pseudocode
\textbf{CURE(no. of points,k)}
\textbf{Input :} A set of points S
\textbf{Output :} K clusters `
1 For every cluster u(each input point), u.mean and u.rep store the mean of the points in cluster and set of c(initially = 1 since each cluster has one data point) representative points of the cluster. Also u.closest stores cluster closest to u.
2 All the input points are inserted into a k-d tree T
3 Treat each input point as seperate cluster, compute u.closest for each u and then insert each cluster into the heap Q.(clusters are arranged in increasing order of distances between u and u.closest).
4 While size(Q) \ge k
6 Remove the top elemnt of Q(say u) and merge it with its closest cluster u.closest(say v) and compute 7 the new representative points for the merged cluster w. Also remove u and v from T and Q.
8 Also for all the clusters x in Q, update x.closest and relocate x
9 insert w into Q
10 repeat
References
CURE - An Efficient Data Clustering Algorithm for Large Databases