Class 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 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 unit
        cluster - the IDs of the feature vectors of the current cluster
        model - 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 for
        dim - 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 for
        dim - 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 join
        all - the overall number of feature vectors
        tau - 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)
      • toString

        public java.lang.String toString()
        Calls the super method and adds additionally the coverage, and the dense units of this subspace.
        Overrides:
        toString in class Subspace