SUBCLU

From HandWiki

SUBCLU is an algorithm for clustering high-dimensional data by Karin Kailing, Hans-Peter Kriegel and Peer Kröger.[1] It is a subspace clustering algorithm that builds on the density-based clustering algorithm DBSCAN. SUBCLU can find clusters in axis-parallel subspaces, and uses a bottom-up, greedy strategy to remain efficient.

Approach

SUBCLU uses a monotonicity criteria: if a cluster is found in a subspace [math]\displaystyle{ S }[/math], then each subspace [math]\displaystyle{ T \subseteq S }[/math] also contains a cluster. However, a cluster [math]\displaystyle{ C \subseteq DB }[/math] in subspace [math]\displaystyle{ S }[/math] is not necessarily a cluster in [math]\displaystyle{ T \subseteq S }[/math], since clusters are required to be maximal, and more objects might be contained in the cluster in [math]\displaystyle{ T }[/math] that contains [math]\displaystyle{ C }[/math]. However, a density-connected set in a subspace [math]\displaystyle{ S }[/math] is also a density-connected set in [math]\displaystyle{ T \subseteq S }[/math].

This downward-closure property is utilized by SUBCLU in a way similar to the Apriori algorithm: first, all 1-dimensional subspaces are clustered. All clusters in a higher-dimensional subspace will be subsets of the clusters detected in this first clustering. SUBCLU hence recursively produces [math]\displaystyle{ k+1 }[/math]-dimensional candidate subspaces by combining [math]\displaystyle{ k }[/math]-dimensional subspaces with clusters sharing [math]\displaystyle{ k-1 }[/math] attributes. After pruning irrelevant candidates, DBSCAN is applied to the candidate subspace to find out if it still contains clusters. If it does, the candidate subspace is used for the next combination of subspaces. In order to improve the runtime of DBSCAN, only the points known to belong to clusters in one [math]\displaystyle{ k }[/math]-dimensional subspace (which is chosen to contain as little clusters as possible) are considered. Due to the downward-closure property, other point cannot be part of a [math]\displaystyle{ k+1 }[/math]-dimensional cluster anyway.

Pseudocode

SUBCLU takes two parameters, [math]\displaystyle{ \epsilon\!\, }[/math] and [math]\displaystyle{ MinPts }[/math], which serve the same role as in DBSCAN. In a first step, DBSCAN is used to find 1D-clusters in each subspace spanned by a single attribute:

[math]\displaystyle{ \mathtt{SUBCLU}(DB, eps, MinPts) }[/math]

[math]\displaystyle{ S_1 := \emptyset }[/math]
[math]\displaystyle{ C_1 := \emptyset }[/math]
[math]\displaystyle{ \mathtt{for\, each}\, a \in Attributes }[/math]
[math]\displaystyle{ C^{\{a\}} = \mathtt{DBSCAN}(DB, \{a\}, eps, MinPts)\!\, }[/math]
[math]\displaystyle{ \mathtt{if} (C^{\{a\}} \neq \emptyset) }[/math]
[math]\displaystyle{ S_1 := S_1 \cup \{a\} }[/math]
[math]\displaystyle{ C_1 := C_1 \cup C^{\{a\}} }[/math]
[math]\displaystyle{ \mathtt{end\, if} }[/math]
[math]\displaystyle{ \mathtt{end\, for} }[/math]
// In a second step, [math]\displaystyle{ k+1 }[/math]-dimensional clusters are built from [math]\displaystyle{ k }[/math]-dimensional ones:
[math]\displaystyle{ k := 1\!\, }[/math]
[math]\displaystyle{ \mathtt{while} (C_k \neq \emptyset) }[/math]
[math]\displaystyle{ \mathtt{CandS}_{k+1} := \mathtt{GenerateCandidateSubspaces}(S_k)\!\, }[/math]
[math]\displaystyle{ \mathtt{for\, each}\, cand \in \mathtt{CandS}_{k+1} }[/math]
[math]\displaystyle{ \mathtt{bestSubspace :=} \min_{s \in S_k \wedge s \subset cand} \sum_{C_i \in C^s} |C_i| }[/math]
[math]\displaystyle{ C^{cand} := \emptyset }[/math]
[math]\displaystyle{ \mathtt{for\, each\, cluster}\, cl \in C^\mathtt{bestSubspace} }[/math]
[math]\displaystyle{ C^{cand} := C^{cand} \cup \mathtt{DBSCAN}(cl, cand, eps, MinPts) }[/math]
[math]\displaystyle{ \mathtt{if}\, (C^{cand} \neq \emptyset) }[/math]
[math]\displaystyle{ S_{k+1} := S_{k+1} \cup cand }[/math]
[math]\displaystyle{ C_{k+1} := C_{k+1} \cup C^{cand} }[/math]
[math]\displaystyle{ \mathtt{end\, if} }[/math]
[math]\displaystyle{ \mathtt{end\, for} }[/math]
[math]\displaystyle{ \mathtt{end\, for} }[/math]
[math]\displaystyle{ k:=k+1\!\, }[/math]
[math]\displaystyle{ \mathtt{end\, while} }[/math]

[math]\displaystyle{ \mathtt{end}\!\, }[/math]

The set [math]\displaystyle{ S_k }[/math] contains all the [math]\displaystyle{ k }[/math]-dimensional subspaces that are known to contain clusters. The set [math]\displaystyle{ C_k }[/math] contains the sets of clusters found in the subspaces. The [math]\displaystyle{ bestSubspace }[/math] is chosen to minimize the runs of DBSCAN (and the number of points that need to be considered in each run) for finding the clusters in the candidate subspaces.

Candidate subspaces are generated much alike the Apriori algorithm generates the frequent itemset candidates: Pairs of the [math]\displaystyle{ k }[/math]-dimensional subspaces are compared, and if they differ in one attribute only, they form a [math]\displaystyle{ k+1 }[/math]-dimensional candidate. However, a number of irrelevant candidates are found as well; they contain a [math]\displaystyle{ k }[/math]-dimensional subspace that does not contain a cluster. Hence, these candidates are removed in a second step:

[math]\displaystyle{ \mathtt{GenerateCandidateSubspaces}(S_k) }[/math]

[math]\displaystyle{ \mathtt{CandS}_{k+1} := \emptyset }[/math]
[math]\displaystyle{ \mathtt{for\,each}\,s_1 \in S_k }[/math]
[math]\displaystyle{ \mathtt{for\,each}\,s_2 \in S_k }[/math]
[math]\displaystyle{ \mathtt{if}\,(s_1\,\mathtt{and}\,s_2\,\,\mathtt{differ\,\,in\,\,exactly\,\,one\,\,attribute}) }[/math]
[math]\displaystyle{ \mathtt{CandS}_{k+1} := \mathtt{CandS}_{k+1} \cup \{s_1 \cup s_2\} }[/math]
[math]\displaystyle{ \mathtt{end\,if} }[/math]
[math]\displaystyle{ \mathtt{end\,for} }[/math]
[math]\displaystyle{ \mathtt{end\,for} }[/math]
// Pruning of irrelevant candidate subspaces
[math]\displaystyle{ \mathtt{for\,each}\,cand \in \mathtt{CandS}_{k+1} }[/math]
[math]\displaystyle{ \mathtt{for\, each}\, k\texttt{-element}\,s \subset cand }[/math]
[math]\displaystyle{ \mathtt{if} \, (s \not \in S_k) }[/math]
[math]\displaystyle{ \mathtt{CandS}_{k+1} = \mathtt{CandS}_{k+1} \setminus \{cand\} }[/math]
[math]\displaystyle{ \mathtt{end\,if} }[/math]
[math]\displaystyle{ \mathtt{end\,for} }[/math]
[math]\displaystyle{ \mathtt{end\,for} }[/math]

[math]\displaystyle{ \mathtt{end}\,\! }[/math]

Availability

An example implementation of SUBCLU is available in the ELKI framework.

References

  1. Karin Kailing, Hans-Peter Kriegel and Peer Kröger. Density-Connected Subspace Clustering for High-Dimensional Data. In: Proc. SIAM Int. Conf. on Data Mining (SDM'04), pp. 246-257, 2004.