Package elki.clustering.subspace.clique
Class CLIQUESubspace
- java.lang.Object
-
- elki.data.Subspace
-
- elki.clustering.subspace.clique.CLIQUESubspace
-
public class CLIQUESubspace extends Subspace
Represents a subspace of the original data space in the CLIQUE algorithm.- Since:
- 0.1
- Author:
- Elke Achtert
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<CLIQUESubspace>
BY_COVERAGE
A partial comparator for CLIQUESubspaces based on their coverage.private int
coverage
The coverage of this subspace, which is the number of all feature vectors that fall inside the dense units of this subspace.private java.util.List<CLIQUEUnit>
denseUnits
The dense units belonging to this subspace.-
Fields inherited from class elki.data.Subspace
DIMENSION_COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description CLIQUESubspace(int dimension)
Creates a new one-dimensional subspace of the original data space.CLIQUESubspace(long[] dimensions)
Creates a new k-dimensional subspace of the original data space.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDenseUnit(CLIQUEUnit unit)
Adds the specified dense unit to this subspace.java.util.List<Pair<Subspace,ModifiableDBIDs>>
determineClusters()
Determines all clusters in this subspace by performing a depth-first search algorithm to find connected dense units.void
dfs(CLIQUEUnit unit, ModifiableDBIDs cluster, CLIQUESubspace model)
Depth-first search algorithm to find connected dense units in this subspace that build a cluster.int
getCoverage()
Returns the coverage of this subspace, which is the number of all feature vectors that fall inside the dense units of this subspace.CLIQUESubspace
join(CLIQUESubspace other, double all, double tau)
Joins this subspace and its dense units with the specified subspace and its dense units.protected CLIQUEUnit
leftNeighbor(CLIQUEUnit unit, int dim)
Returns the left neighbor of the given unit in the specified dimension.protected CLIQUEUnit
rightNeighbor(CLIQUEUnit unit, int dim)
Returns the right neighbor of the given unit in the specified dimension.java.lang.String
toString()
Calls the super method and adds additionally the coverage, and the dense units of this subspace.-
Methods inherited from class elki.data.Subspace
dimensionality, dimensionsToString, dimensonsToString, equals, getDimensions, hashCode, isSubspace, join, joinLastDimensions
-
-
-
-
Field Detail
-
denseUnits
private java.util.List<CLIQUEUnit> denseUnits
The dense units belonging to this subspace.
-
coverage
private int coverage
The coverage of this subspace, which is the number of all feature vectors that fall inside the dense units of this subspace.
-
BY_COVERAGE
public static final java.util.Comparator<CLIQUESubspace> BY_COVERAGE
A partial comparator for CLIQUESubspaces based on their coverage. The CLIQUESubspaces are reverse ordered by the values of their coverage.Compares the two specified CLIQUESubspaces for order. Returns a negative integer, zero, or a positive integer if the coverage of the first subspace is greater than, equal to, or less than the coverage of the second subspace. I.e. the subspaces are reverse ordered by the values of their coverage.
Note: this comparator provides an ordering that is inconsistent with equals.
-
-
Constructor Detail
-
CLIQUESubspace
public CLIQUESubspace(int dimension)
Creates a new one-dimensional subspace of the original data space.- Parameters:
dimension
- the dimension building this subspace
-
CLIQUESubspace
public CLIQUESubspace(long[] dimensions)
Creates a new k-dimensional subspace of the original data space.- Parameters:
dimensions
- the dimensions building this subspace
-
-
Method Detail
-
addDenseUnit
public void addDenseUnit(CLIQUEUnit unit)
Adds the specified dense unit to this subspace.- Parameters:
unit
- the unit to be added.
-
determineClusters
public java.util.List<Pair<Subspace,ModifiableDBIDs>> determineClusters()
Determines all clusters in this subspace by performing a depth-first search algorithm to find connected dense units.- Returns:
- the clusters in this subspace and the corresponding cluster models
-
dfs
public void dfs(CLIQUEUnit unit, ModifiableDBIDs cluster, CLIQUESubspace model)
Depth-first search algorithm to find connected dense units in this subspace that build a cluster. It starts with a unit, assigns it to a cluster and finds all units it is connected to.- Parameters:
unit
- the unitcluster
- the IDs of the feature vectors of the current clustermodel
- the model of the cluster
-
leftNeighbor
protected CLIQUEUnit leftNeighbor(CLIQUEUnit unit, int dim)
Returns the left neighbor of the given unit in the specified dimension.- Parameters:
unit
- the unit to determine the left neighbor fordim
- the dimension- Returns:
- the left neighbor of the given unit in the specified dimension
-
rightNeighbor
protected CLIQUEUnit rightNeighbor(CLIQUEUnit unit, int dim)
Returns the right neighbor of the given unit in the specified dimension.- Parameters:
unit
- the unit to determine the right neighbor fordim
- the dimension- Returns:
- the right neighbor of the given unit in the specified dimension
-
getCoverage
public int getCoverage()
Returns the coverage of this subspace, which is the number of all feature vectors that fall inside the dense units of this subspace.- Returns:
- the coverage of this subspace
-
join
public CLIQUESubspace join(CLIQUESubspace other, double all, double tau)
Joins this subspace and its dense units with the specified subspace and its dense units. The join is only successful if both subspaces have the first k-1 dimensions in common (where k is the number of dimensions) and the last dimension of this subspace is less than the last dimension of the specified subspace.- Parameters:
other
- the subspace to joinall
- the overall number of feature vectorstau
- the density threshold for the selectivity of a unit- Returns:
- the join of this subspace with the specified subspace if the join condition is fulfilled, null otherwise.
- See Also:
Subspace.joinLastDimensions(elki.data.Subspace)
-
-