Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.algorithm.clustering.correlation
Class COPAC<V extends RealVector<V,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<V,Clustering<Model>>
              extended by de.lmu.ifi.dbs.elki.algorithm.clustering.correlation.COPAC<V>
Type Parameters:
V - the type of RealVector handled by this Algorithm
All Implemented Interfaces:
Algorithm<V,Clustering<Model>>, ClusteringAlgorithm<Clustering<Model>,V>, Parameterizable

public class COPAC<V extends RealVector<V,?>>
extends AbstractAlgorithm<V,Clustering<Model>>
implements ClusteringAlgorithm<Clustering<Model>,V>

Provides the COPAC algorithm, an algorithm to partition a database according to the correlation dimension of its objects and to then perform an arbitrary clustering algorithm over the partitions.

Reference: Achtert E., Böhm C., Kriegel H.-P., Kröger P., Zimek A.: Robust, Complete, and Efficient Correlation Clustering.
In Proc. 7th SIAM International Conference on Data Mining (SDM'07), Minneapolis, MN, 2007

Author:
Arthur Zimek

Field Summary
static OptionID PARTITION_ALGORITHM_ID
          OptionID for PARTITION_ALGORITHM_PARAM
protected  ClassParameter<ClusteringAlgorithm<Clustering<Model>,V>> PARTITION_ALGORITHM_PARAM
          Parameter to specify the clustering algorithm to apply to each partition, must extend ClusteringAlgorithm.
static OptionID PARTITION_DB_ID
          OptionID for {#PARTITION_DB_PARAM}
private  ClassParameter<Database<V>> PARTITION_DB_PARAM
          Parameter to specify the database class for each partition, must extend Database.
private  ClusteringAlgorithm<Clustering<Model>,V> partitionAlgorithm
          Holds the instance of the partitioning algorithm specified by PARTITION_ALGORITHM_PARAM.
private  Class<? extends Database<V>> partitionDatabase
          Holds the instance of the partition database specified by PARTITION_DB_PARAM.
private  List<String> partitionDatabaseParameters
          Holds the parameters of the partition databases.
private  HiCOPreprocessor<V> preprocessor
          Holds the instance of preprocessor specified by PREPROCESSOR_PARAM.
static OptionID PREPROCESSOR_ID
          OptionID for PREPROCESSOR_PARAM
private  ClassParameter<HiCOPreprocessor<V>> PREPROCESSOR_PARAM
          Parameter to specify the preprocessor to derive partition criterion, must extend HiCOPreprocessor.
private  Clustering<Model> result
          Holds the result.
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
COPAC()
          Adds parameters PREPROCESSOR_PARAM, PARTITION_ALGORITHM_PARAM, and PARTITION_DB_PARAM to the option handler additionally to parameters of super class.
 
Method Summary
 Description getDescription()
          Returns a description of the algorithm.
 ClusteringAlgorithm<Clustering<Model>,V> getPartitionAlgorithm()
          Returns the partition algorithm.
 Clustering<Model> getResult()
          Retrieve the result.
protected  Clustering<Model> runInTime(Database<V> database)
          Performs the COPAC algorithm on the given database.
private  void runPartitionAlgorithm(Database<V> database, Map<Integer,List<Integer>> partitionMap)
          Runs the partition algorithm and creates the result.
 List<String> setParameters(List<String> args)
          Calls the super method and instantiates partitionAlgorithm according to the value of parameter PARTITION_ALGORITHM_PARAM, partitionDatabase according to the value of parameter PARTITION_DB_PARAM (if specified), and preprocessor according to the value of parameter PREPROCESSOR_PARAM.
 
Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm
isTime, isVerbose, run, setTime, setVerbose
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.algorithm.clustering.ClusteringAlgorithm
run
 
Methods inherited from interface de.lmu.ifi.dbs.elki.algorithm.Algorithm
setTime, setVerbose
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription
 

Field Detail

PREPROCESSOR_ID

public static final OptionID PREPROCESSOR_ID
OptionID for PREPROCESSOR_PARAM


PREPROCESSOR_PARAM

private final ClassParameter<HiCOPreprocessor<V extends RealVector<V,?>>> PREPROCESSOR_PARAM
Parameter to specify the preprocessor to derive partition criterion, must extend HiCOPreprocessor.

Key: -copac.preprocessor


preprocessor

private HiCOPreprocessor<V extends RealVector<V,?>> preprocessor
Holds the instance of preprocessor specified by PREPROCESSOR_PARAM.


PARTITION_ALGORITHM_ID

public static final OptionID PARTITION_ALGORITHM_ID
OptionID for PARTITION_ALGORITHM_PARAM


PARTITION_ALGORITHM_PARAM

protected final ClassParameter<ClusteringAlgorithm<Clustering<Model>,V extends RealVector<V,?>>> PARTITION_ALGORITHM_PARAM
Parameter to specify the clustering algorithm to apply to each partition, must extend ClusteringAlgorithm.

Key: -copac.partitionAlgorithm


partitionAlgorithm

private ClusteringAlgorithm<Clustering<Model>,V extends RealVector<V,?>> partitionAlgorithm
Holds the instance of the partitioning algorithm specified by PARTITION_ALGORITHM_PARAM.


PARTITION_DB_ID

public static final OptionID PARTITION_DB_ID
OptionID for {#PARTITION_DB_PARAM}


PARTITION_DB_PARAM

private final ClassParameter<Database<V extends RealVector<V,?>>> PARTITION_DB_PARAM
Parameter to specify the database class for each partition, must extend Database.

Key: -copac.partitionDB


partitionDatabase

private Class<? extends Database<V extends RealVector<V,?>>> partitionDatabase
Holds the instance of the partition database specified by PARTITION_DB_PARAM.


partitionDatabaseParameters

private List<String> partitionDatabaseParameters
Holds the parameters of the partition databases.


result

private Clustering<Model> result
Holds the result.

Constructor Detail

COPAC

public COPAC()
Adds parameters PREPROCESSOR_PARAM, PARTITION_ALGORITHM_PARAM, and PARTITION_DB_PARAM to the option handler additionally to parameters of super class.

Method Detail

runInTime

protected Clustering<Model> runInTime(Database<V> database)
                               throws IllegalStateException
Performs the COPAC algorithm on the given database.

Specified by:
runInTime in class AbstractAlgorithm<V extends RealVector<V,?>,Clustering<Model>>
Parameters:
database - the database to run the algorithm on
Returns:
the Result computed by this algorithm
Throws:
IllegalStateException - if the algorithm has not been initialized properly (e.g. the setParameters(String[]) method has been failed to be called).

getResult

public Clustering<Model> getResult()
Description copied from interface: ClusteringAlgorithm
Retrieve the result.

Specified by:
getResult in interface Algorithm<V extends RealVector<V,?>,Clustering<Model>>
Specified by:
getResult in interface ClusteringAlgorithm<Clustering<Model>,V extends RealVector<V,?>>
Returns:
the result of the algorithm

getDescription

public Description getDescription()
Description copied from interface: Algorithm
Returns a description of the algorithm.

Specified by:
getDescription in interface Algorithm<V extends RealVector<V,?>,Clustering<Model>>
Returns:
a description of the algorithm

setParameters

public List<String> setParameters(List<String> args)
                           throws ParameterException
Calls the super method and instantiates partitionAlgorithm according to the value of parameter PARTITION_ALGORITHM_PARAM, partitionDatabase according to the value of parameter PARTITION_DB_PARAM (if specified), and preprocessor according to the value of parameter PREPROCESSOR_PARAM.

The remaining parameters are passed to the partitionAlgorithm, then to the partitionDatabase and afterwards to the preprocessor.

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractAlgorithm<V extends RealVector<V,?>,Clustering<Model>>
Parameters:
args - parameters to set the attributes accordingly to
Returns:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting

runPartitionAlgorithm

private void runPartitionAlgorithm(Database<V> database,
                                   Map<Integer,List<Integer>> partitionMap)
Runs the partition algorithm and creates the result.

Parameters:
database - the database to run this algorithm on
partitionMap - the map of partition IDs to object ids

getPartitionAlgorithm

public ClusteringAlgorithm<Clustering<Model>,V> getPartitionAlgorithm()
Returns the partition algorithm.

Returns:
the specified partition algorithm

Release 0.2.1 (2009-07-13_1605)