Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction
Class ERiCDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<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.distance.AbstractMeasurementFunction<O,D>
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<O,D>
                  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPreprocessorBasedDistanceFunction<V,P,BitDistance>
                      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.ERiCDistanceFunction<V,P>
All Implemented Interfaces:
DistanceFunction<V,BitDistance>, MeasurementFunction<V,BitDistance>, Loggable, Parameterizable

public class ERiCDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>>
extends AbstractPreprocessorBasedDistanceFunction<V,P,BitDistance>

Provides a distance function for building the hierarchiy in the ERiC algorithm.

Author:
Elke Achtert

Field Summary
static AssociationID ASSOCIATION_ID
          The Assocoiation ID for the association to be set by the preprocessor.
static double DEFAULT_DELTA
          The default value for delta.
static String DEFAULT_PREPROCESSOR_CLASS
          The default preprocessor class name.
static double DEFAULT_TAU
          The default value for delta.
private  double delta
          The threshold for approximate linear dependency.
static String DELTA_D
          Description for parameter delta.
static String DELTA_P
          Option string for parameter delta.
static String PREPROCESSOR_CLASS_D
          Description for parameter preprocessor.
static Class<Preprocessor> PREPROCESSOR_SUPER_CLASS
          The super class for the preprocessor.
private  double tau
          The threshold for parallel subspaces.
static String TAU_D
          Description for parameter delta.
static String TAU_P
          Option string for parameter delta.
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
INFINITY_PATTERN
 
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
 
Constructor Summary
ERiCDistanceFunction()
          Provides a distance function for the ERiC algorithm.
 
Method Summary
private  boolean approximatelyLinearDependent(LocalPCA<V> pca1, LocalPCA<V> pca2)
          Returns true, if the strong eigenvectors of the two specified pcas span up the same space.
 BitDistance distance(V o1, V o2)
          Note, that the pca of o1 must have equal ore more strong eigenvectors than the pca of o2.
 BitDistance distance(V o1, V o2, LocalPCA<V> pca1, LocalPCA<V> pca2)
          Computes the distance between two given DatabaseObjects according to this distance function.
(package private)  AssociationID getAssociationID()
          Returns the assocoiation ID for the association to be set by the preprocessor.
 List<AttributeSettings> getAttributeSettings()
          Returns the parameter setting of the attributes.
(package private)  String getDefaultPreprocessorClassName()
          Returns the name of the default preprocessor.
(package private)  String getPreprocessorClassDescription()
          Returns the description for parameter preprocessor.
(package private)  Class<Preprocessor> getPreprocessorSuperClassName()
          Returns the super class for the preprocessor.
 BitDistance infiniteDistance()
          Provides an infinite distance.
 BitDistance nullDistance()
          Provides a null distance.
 String[] setParameters(String[] args)
          Sets the values for the parameters delta and preprocessor if specified.
 BitDistance undefinedDistance()
          Provides an undefined distance.
 BitDistance valueOf(String pattern)
          Provides a measurement suitable to this measurement function based on the given pattern.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPreprocessorBasedDistanceFunction
getPreprocessor, setDatabase
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction
distance, distance, isInfiniteDistance, isNullDistance, isUndefinedDistance
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
getDatabase, matches, requiredInputPattern, setRequiredInputPattern
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, checkGlobalParameterConstraints, deleteOption, description, description, description, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, 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.distance.MeasurementFunction
requiredInputPattern
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, description, getParameters, getPossibleOptions, inlineDescription
 

Field Detail

DEFAULT_DELTA

public static final double DEFAULT_DELTA
The default value for delta.

See Also:
Constant Field Values

DELTA_P

public static final String DELTA_P
Option string for parameter delta.

See Also:
Constant Field Values

DELTA_D

public static final String DELTA_D
Description for parameter delta.

See Also:
Constant Field Values

DEFAULT_TAU

public static final double DEFAULT_TAU
The default value for delta.

See Also:
Constant Field Values

TAU_P

public static final String TAU_P
Option string for parameter delta.

See Also:
Constant Field Values

TAU_D

public static final String TAU_D
Description for parameter delta.

See Also:
Constant Field Values

ASSOCIATION_ID

public static final AssociationID ASSOCIATION_ID
The Assocoiation ID for the association to be set by the preprocessor.


PREPROCESSOR_SUPER_CLASS

public static final Class<Preprocessor> PREPROCESSOR_SUPER_CLASS
The super class for the preprocessor.


DEFAULT_PREPROCESSOR_CLASS

public static final String DEFAULT_PREPROCESSOR_CLASS
The default preprocessor class name.


PREPROCESSOR_CLASS_D

public static final String PREPROCESSOR_CLASS_D
Description for parameter preprocessor.


delta

private double delta
The threshold for approximate linear dependency.


tau

private double tau
The threshold for parallel subspaces.

Constructor Detail

ERiCDistanceFunction

public ERiCDistanceFunction()
Provides a distance function for the ERiC algorithm.

Method Detail

setParameters

public String[] setParameters(String[] args)
                       throws ParameterException
Description copied from class: AbstractPreprocessorBasedDistanceFunction
Sets the values for the parameters delta and preprocessor if specified. If the parameters are not specified default values are set.

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractPreprocessorBasedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>,BitDistance>
Parameters:
args - parameters to set the attributes accordingly to
Returns:
String[] an array containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting
See Also:
Parameterizable.setParameters(String[])

getAttributeSettings

public List<AttributeSettings> getAttributeSettings()
Returns the parameter setting of the attributes.

Specified by:
getAttributeSettings in interface Parameterizable
Overrides:
getAttributeSettings in class AbstractPreprocessorBasedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>,BitDistance>
Returns:
the parameter setting of the attributes
See Also:
Parameterizable.getAttributeSettings()

getDefaultPreprocessorClassName

String getDefaultPreprocessorClassName()
Returns the name of the default preprocessor.

Specified by:
getDefaultPreprocessorClassName in class AbstractPreprocessorBasedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>,BitDistance>

getPreprocessorClassDescription

String getPreprocessorClassDescription()
Returns the description for parameter preprocessor.

Specified by:
getPreprocessorClassDescription in class AbstractPreprocessorBasedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>,BitDistance>

getPreprocessorSuperClassName

Class<Preprocessor> getPreprocessorSuperClassName()
Returns the super class for the preprocessor.

Specified by:
getPreprocessorSuperClassName in class AbstractPreprocessorBasedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>,BitDistance>

getAssociationID

AssociationID getAssociationID()
Returns the assocoiation ID for the association to be set by the preprocessor.

Specified by:
getAssociationID in class AbstractPreprocessorBasedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>,BitDistance>

valueOf

public BitDistance valueOf(String pattern)
                    throws IllegalArgumentException
Description copied from interface: MeasurementFunction
Provides a measurement suitable to this measurement function based on the given pattern.

Parameters:
pattern - a pattern defining a similarity suitable to this measurement function
Returns:
a measurement suitable to this measurement function based on the given pattern
Throws:
IllegalArgumentException - if the given pattern is not compatible with the requirements of this measurement function
See Also:
MeasurementFunction.valueOf(String)

infiniteDistance

public BitDistance infiniteDistance()
Description copied from interface: MeasurementFunction
Provides an infinite distance.

Returns:
an infinite distance
See Also:
MeasurementFunction.infiniteDistance()

nullDistance

public BitDistance nullDistance()
Description copied from interface: MeasurementFunction
Provides a null distance.

Returns:
a null distance
See Also:
MeasurementFunction.nullDistance()

undefinedDistance

public BitDistance undefinedDistance()
Description copied from interface: MeasurementFunction
Provides an undefined distance.

Returns:
an undefined distance
See Also:
MeasurementFunction.undefinedDistance()

distance

public BitDistance distance(V o1,
                            V o2)
Note, that the pca of o1 must have equal ore more strong eigenvectors than the pca of o2.

Parameters:
o1 - first DatabaseObject
o2 - second DatabaseObject
Returns:
the distance between two given DatabaseObjects according to this distance function
See Also:
DistanceFunction.distance(de.lmu.ifi.dbs.elki.data.DatabaseObject, de.lmu.ifi.dbs.elki.data.DatabaseObject)

distance

public BitDistance distance(V o1,
                            V o2,
                            LocalPCA<V> pca1,
                            LocalPCA<V> pca2)
Computes the distance between two given DatabaseObjects according to this distance function. Note, that the first pca must have equal or more strong eigenvectors than the second pca.

Parameters:
o1 - first DatabaseObject
o2 - second DatabaseObject
pca1 - first PCA
pca2 - second PCA
Returns:
the distance between two given DatabaseObjects according to this distance function

approximatelyLinearDependent

private boolean approximatelyLinearDependent(LocalPCA<V> pca1,
                                             LocalPCA<V> pca2)
Returns true, if the strong eigenvectors of the two specified pcas span up the same space. Note, that the first pca must have equal ore more strong eigenvectors than the second pca.

Parameters:
pca1 - first PCA
pca2 - second PCA
Returns:
true, if the strong eigenvectors of the two specified pcas span up the same space

Release 0.1 (2008-07-10_1838)