Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction.correlation
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.correlation.ERiCDistanceFunction<V,P>
Type Parameters:
V - the type of RealVector to compute the distances in between
P - the type of Preprocessor used
All Implemented Interfaces:
DistanceFunction<V,BitDistance>, MeasurementFunction<V,BitDistance>, PreprocessorBasedMeasurementFunction<V,P,BitDistance>, PreprocessorClient<P,V>, 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
private  double delta
          Holds the value of DELTA_PARAM.
static OptionID DELTA_ID
          OptionID for DELTA_PARAM
private  DoubleParameter DELTA_PARAM
          Parameter to specify the threshold for approximate linear dependency: the strong eigenvectors of q are approximately linear dependent from the strong eigenvectors p if the following condition holds for all stroneg eigenvectors q_i of q (lambda_q < lambda_p): q_i' * M^check_p * q_i <= delta^2, must be a double equal to or greater than 0.
private  double tau
          Holds the value of TAU_PARAM.
static OptionID TAU_ID
          OptionID for TAU_PARAM
private  DoubleParameter TAU_PARAM
          Parameter to specify the threshold for the maximum distance between two approximately linear dependent subspaces of two objects p and q (lambda_q < lambda_p) before considering them as parallel, must be a double equal to or greater than 0.
 
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, logger
 
Constructor Summary
ERiCDistanceFunction()
          Provides a distance function for the ERiC algorithm, adding parameters DELTA_PARAM and {#TAU_PARAM} to the option handler additionally to parameters of super class.
 
Method Summary
private  boolean approximatelyLinearDependent(PCAFilteredResult pca1, PCAFilteredResult pca2)
          Returns true, if the strong eigenvectors of the two specified pcas span up the same space.
 BitDistance distance(V v1, V v2)
          Note, that the pca of o1 must have equal ore more strong eigenvectors than the pca of o2.
 BitDistance distance(V v1, V v2, PCAFilteredResult pca1, PCAFilteredResult pca2)
          Computes the distance between two given DatabaseObjects according to this distance function.
 AssociationID<?> getAssociationID()
          Returns the association ID for the association to be set by the preprocessor.
 String getDefaultPreprocessorClassName()
          Returns the name of the default preprocessor.
 String getPreprocessorDescription()
          Returns the description for the preprocessor parameter.
 Class<P> getPreprocessorSuperClass()
          Returns the super class for the preprocessor parameter.
 BitDistance infiniteDistance()
          Provides an infinite distance.
 BitDistance nullDistance()
          Provides a null distance.
 List<String> setParameters(List<String> args)
          Calls the super method AbstractPreprocessorBasedDistanceFunction#setParameters(args)} and sets additionally the values of the parameters DELTA_PARAM and {#TAU_PARAM}.
 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, shortDescription
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable
 
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.distance.MeasurementFunction
isInfiniteDistance, isNullDistance, isUndefinedDistance, requiredInputPattern
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription
 

Field Detail

DELTA_ID

public static final OptionID DELTA_ID
OptionID for DELTA_PARAM


DELTA_PARAM

private final DoubleParameter DELTA_PARAM
Parameter to specify the threshold for approximate linear dependency: the strong eigenvectors of q are approximately linear dependent from the strong eigenvectors p if the following condition holds for all stroneg eigenvectors q_i of q (lambda_q < lambda_p): q_i' * M^check_p * q_i <= delta^2, must be a double equal to or greater than 0.

Default value: 0.1

Key: -ericdf.delta


TAU_ID

public static final OptionID TAU_ID
OptionID for TAU_PARAM


TAU_PARAM

private final DoubleParameter TAU_PARAM
Parameter to specify the threshold for the maximum distance between two approximately linear dependent subspaces of two objects p and q (lambda_q < lambda_p) before considering them as parallel, must be a double equal to or greater than 0.

Default value: 0.1

Key: -ericdf.tau


delta

private double delta
Holds the value of DELTA_PARAM.


tau

private double tau
Holds the value of TAU_PARAM.

Constructor Detail

ERiCDistanceFunction

public ERiCDistanceFunction()
Provides a distance function for the ERiC algorithm, adding parameters DELTA_PARAM and {#TAU_PARAM} to the option handler additionally to parameters of super class.

Method Detail

setParameters

public List<String> setParameters(List<String> args)
                           throws ParameterException
Calls the super method AbstractPreprocessorBasedDistanceFunction#setParameters(args)} and sets additionally the values of the parameters DELTA_PARAM and {#TAU_PARAM}.

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:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting

getDefaultPreprocessorClassName

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

Returns:
the name of the default preprocessor, which is KnnQueryBasedHiCOPreprocessor

getPreprocessorDescription

public String getPreprocessorDescription()
Description copied from interface: PreprocessorClient
Returns the description for the preprocessor parameter.

Returns:
the description for the preprocessor parameter

getPreprocessorSuperClass

public Class<P> getPreprocessorSuperClass()
Description copied from interface: PreprocessorClient
Returns the super class for the preprocessor parameter.

Returns:
the super class for the preprocessor parameter, which is Preprocessor

getAssociationID

public AssociationID<?> getAssociationID()
Description copied from interface: PreprocessorClient
Returns the association ID for the association to be set by the preprocessor.

Returns:
the association ID for the association to be set by the preprocessor, which is AssociationID.LOCAL_PCA

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

infiniteDistance

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

Returns:
an infinite distance

nullDistance

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

Returns:
a null distance

undefinedDistance

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

Returns:
an undefined distance

distance

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

Parameters:
v1 - first DatabaseObject
v2 - second DatabaseObject
Returns:
the distance between two given DatabaseObjects according to this distance function

distance

public BitDistance distance(V v1,
                            V v2,
                            PCAFilteredResult pca1,
                            PCAFilteredResult 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:
v1 - first DatabaseObject
v2 - second DatabaseObject
pca1 - first PCA
pca2 - second PCA
Returns:
the distance between two given DatabaseObjects according to this distance function

approximatelyLinearDependent

private boolean approximatelyLinearDependent(PCAFilteredResult pca1,
                                             PCAFilteredResult 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.2.1 (2009-07-13_1605)