ROCK (robust clustering using linKs) Clustering algorithm is a robust clustering algorithm for categorical attributes. The algorithm belongs to the hierarchical clustering algorithm of condensed type. The reason for this is that the number of common neighbors (similar sample points) is taken into account when confirming the relationship between the two objects (sample points/clusters), which is called the concept of link in the algorithm. Some clustering algorithms only focus on the similarity between objects.
Four key concepts used in the ROCK algorithm
- Neighbor (Neighbors): If the similarity of two sample points reaches the threshold value (θ), the two sample points are neighbors. The threshold value (θ) is specified by the user, and the similarity is calculated by the user-specified similarity function. The similarity calculation methods of the common classification attributes are:jaccard coefficients , cosine similarity degree.
- Links: Number of common neighbors for two objects
- Objective functions (Criterion function): Maximize the following objective function for optimal clustering results (the total number of links between the final clusters is minimal, and the total number of links in the cluster is the largest). Ci: The first cluster, K: the number of clusters, the size of the NI:CI (number of sample points). It is generally possible to use f (θ) = (1-θ)/(1+θ). f (θ) generally has the following properties: Each sample point in CI has a nif (θ) neighbor in CI. (see reference 2 for details)
4. Measurement of Similarity (Goodness Measure): Use this formula to calculate the 22 similarity of all objects, merging two objects with the highest similarity. Through this similarity measure the constant condensation object to K clusters, the final calculation of the above objective function value is necessarily the largest.
, link[ci,cj]=
Approximate algorithm ideas (pseudo-code see reference 2):
Input: Number of clusters required-K, and similarity threshold-θ
Algorithm:
At first, each point is a separate cluster, and a similarity matrix is generated based on the similarity between the calculated point and the point.
The neighbor Matrix-A is computed based on the similarity degree matrix and the similarity threshold-θ. If the two-point similarity is >=θ, take a value of 1 (neighbor), otherwise the value is 0.
Calculate link matrix-l=a x A
Calculates the measure of similarity (Goodness Measure), merging two objects with the highest similarity. Go back to the 2nd step and iterate until the number of k clusters or clusters does not change.
Output:
Clusters and outliers (not necessarily present)
ROCK in R-CBA Bag:
Load (' country. RData ') d<-dist (Countries[,-1]) X<-as.matrix (d) library (CBA) RC <-rockcluster (x, n=4, theta=0.2, Debug=true) Rc$cl
Reference documents:
"1" http://www.enggjournals.com/ijcse/doc/IJCSE12-04-05-248.pdf
"2" http://www.cis.upenn.edu/~sudipto/mypapers/categorical.pdf
ROCK Clustering algorithm?