Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.algorithm.clustering.subspace.clique
Class CLIQUEUnit<V extends RealVector<V,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.algorithm.clustering.subspace.clique.CLIQUEUnit<V>
Type Parameters:
V - the type of RealVector handled by this Algorithm

public class CLIQUEUnit<V extends RealVector<V,?>>
extends Object

Represents a unit in the CLIQUE algorithm.

Author:
Elke Achtert

Field Summary
private  boolean assigned
          Flag that indicates if this unit is already assigned to a cluster.
private  Map<Integer,Interval> dimensionToInterval
          Provides a mapping of particular dimensions to the intervals of which this unit is build.
private  Set<Integer> ids
          The ids of the feature vectors this unit contains.
private  SortedSet<Interval> intervals
          The one-dimensional intervals of which this unit is build.
 
Constructor Summary
CLIQUEUnit(Interval interval)
          Creates a new one-dimensional unit for the given interval.
CLIQUEUnit(SortedSet<Interval> intervals, Set<Integer> ids)
          Creates a new k-dimensional unit for the given intervals.
 
Method Summary
 boolean addFeatureVector(V vector)
          Adds the id of the specified feature vector to this unit, if this unit contains the feature vector.
 boolean contains(V vector)
          Returns true, if the intervals of this unit contain the specified feature vector.
 boolean containsLeftNeighbor(Interval i)
          Returns true if this unit contains the left neighbor of the specified interval.
 boolean containsRightNeighbor(Interval i)
          Returns true if this unit contains the right neighbor of the specified interval.
 Set<Integer> getIds()
          Returns the ids of the feature vectors this unit contains.
 Interval getInterval(Integer dimension)
          Returns the interval of the specified dimension.
 Collection<Interval> getIntervals()
          Returns a collection of the intervals of which this unit is build.
 boolean isAssigned()
          Returns true if this unit is already assigned to a cluster.
 CLIQUEUnit<V> join(CLIQUEUnit<V> other, double all, double tau)
          Joins this unit with the specified unit.
 void markAsAssigned()
          Marks this unit as assigned to a cluster.
 int numberOfFeatureVectors()
          Returns the number of feature vectors this unit contains.
 double selectivity(double total)
          Returns the selectivity of this unit, which is defined as the fraction of total feature vectors contained in this unit.
 String toString()
          Returns a string representation of this unit that contains the intervals of this unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

intervals

private SortedSet<Interval> intervals
The one-dimensional intervals of which this unit is build.


dimensionToInterval

private Map<Integer,Interval> dimensionToInterval
Provides a mapping of particular dimensions to the intervals of which this unit is build.


ids

private Set<Integer> ids
The ids of the feature vectors this unit contains.


assigned

private boolean assigned
Flag that indicates if this unit is already assigned to a cluster.

Constructor Detail

CLIQUEUnit

public CLIQUEUnit(SortedSet<Interval> intervals,
                  Set<Integer> ids)
Creates a new k-dimensional unit for the given intervals.

Parameters:
intervals - the intervals belonging to this unit
ids - the ids of the feature vectors belonging to this unit

CLIQUEUnit

public CLIQUEUnit(Interval interval)
Creates a new one-dimensional unit for the given interval.

Parameters:
interval - the interval belonging to this unit
Method Detail

contains

public boolean contains(V vector)
Returns true, if the intervals of this unit contain the specified feature vector.

Parameters:
vector - the feature vector to be tested for containment
Returns:
true, if the intervals of this unit contain the specified feature vector, false otherwise

addFeatureVector

public boolean addFeatureVector(V vector)
Adds the id of the specified feature vector to this unit, if this unit contains the feature vector.

Parameters:
vector - the feature vector to be added
Returns:
true, if this unit contains the specified feature vector, false otherwise

numberOfFeatureVectors

public int numberOfFeatureVectors()
Returns the number of feature vectors this unit contains.

Returns:
the number of feature vectors this unit contains

selectivity

public double selectivity(double total)
Returns the selectivity of this unit, which is defined as the fraction of total feature vectors contained in this unit.

Parameters:
total - the total number of feature vectors
Returns:
the selectivity of this unit

getIntervals

public Collection<Interval> getIntervals()
Returns a collection of the intervals of which this unit is build.

Returns:
a collection of the intervals of which this unit is build

getInterval

public Interval getInterval(Integer dimension)
Returns the interval of the specified dimension.

Parameters:
dimension - the dimension of the interval to be returned
Returns:
the interval of the specified dimension

containsLeftNeighbor

public boolean containsLeftNeighbor(Interval i)
Returns true if this unit contains the left neighbor of the specified interval.

Parameters:
i - the interval
Returns:
true if this unit contains the left neighbor of the specified interval, false otherwise

containsRightNeighbor

public boolean containsRightNeighbor(Interval i)
Returns true if this unit contains the right neighbor of the specified interval.

Parameters:
i - the interval
Returns:
true if this unit contains the right neighbor of the specified interval, false otherwise

isAssigned

public boolean isAssigned()
Returns true if this unit is already assigned to a cluster.

Returns:
true if this unit is already assigned to a cluster, false otherwise.

markAsAssigned

public void markAsAssigned()
Marks this unit as assigned to a cluster.


getIds

public Set<Integer> getIds()
Returns the ids of the feature vectors this unit contains.

Returns:
the ids of the feature vectors this unit contains

join

public CLIQUEUnit<V> join(CLIQUEUnit<V> other,
                          double all,
                          double tau)
Joins this unit with the specified unit.

Parameters:
other - the unit to be joined
all - the overall number of featuer vectors
tau - the density threshold for the selectivity of a unit
Returns:
the joined unit if the selectivity of the join result is equal or greater than tau, null otwerwise

toString

public String toString()
Returns a string representation of this unit that contains the intervals of this unit.

Overrides:
toString in class Object
Returns:
a string representation of this unit

Release 0.2.1 (2009-07-13_1605)