Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction
Class PCABasedCorrelationDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>,D extends CorrelationDistance<D>>

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<O,P,D>
                      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractCorrelationDistanceFunction<O,P,D>
                          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.PCABasedCorrelationDistanceFunction<O,P,D>
All Implemented Interfaces:
DistanceFunction<O,D>, MeasurementFunction<O,D>, Loggable, Parameterizable

public class PCABasedCorrelationDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>,D extends CorrelationDistance<D>>
extends AbstractCorrelationDistanceFunction<O,P,D>

Provides the Correlation distance for real valued vectors.

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.
private  double delta
          The threshold of a distance between a vector q and a given space that indicates that q adds a new dimension to the space.
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<HiCOPreprocessor> PREPROCESSOR_SUPER_CLASS
          The super class for the preprocessor.
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractCorrelationDistanceFunction
SEPARATOR
 
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
PCABasedCorrelationDistanceFunction()
          Provides a CorrelationDistanceFunction with a pattern defined to accept Strings that define an Integer followed by a separator followed by a Double.
 
Method Summary
private  void adjust(Matrix v, Matrix e_czech, Matrix vector, int corrDim)
          Inserts the specified vector into the given orthonormal matrix v at column corrDim.
 int correlationDistance(LocalPCA<O> pca1, LocalPCA<O> pca2, int dimensionality)
          Computes the correlation distance between the two subspaces defined by the specified PCAs.
(package private)  D correlationDistance(O dv1, O dv2)
          Computes the correlation distance between the two specified vectors.
private  double euclideanDistance(O dv1, O dv2)
          Computes the Euklidean distance between the given two vectors.
(package private)  AssociationID getAssociationID()
          Returns the assocoiation ID for the association to be set by the preprocessor.
(package private)  String getDefaultPreprocessorClassName()
          Returns the name of the default preprocessor.
(package private)  String getPreprocessorClassDescription()
          Returns the description for parameter preprocessor.
(package private)  Class<HiCOPreprocessor> getPreprocessorSuperClassName()
          Returns the super class for the preprocessor.
 D infiniteDistance()
          Provides an infinite distance.
 D nullDistance()
          Provides a null distance.
 String[] setParameters(String[] args)
          Sets the values for the parameters delta and preprocessor if specified.
 D undefinedDistance()
          Provides an undefined distance.
 D valueOf(String pattern)
          Provides a distance suitable to this DistanceFunction based on the given pattern.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractCorrelationDistanceFunction
description, distance
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPreprocessorBasedDistanceFunction
getAttributeSettings, 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, 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, getParameters, getPossibleOptions, inlineDescription
 

Field Detail

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<HiCOPreprocessor> 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.


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

delta

private double delta
The threshold of a distance between a vector q and a given space that indicates that q adds a new dimension to the space.

Constructor Detail

PCABasedCorrelationDistanceFunction

public PCABasedCorrelationDistanceFunction()
Provides a CorrelationDistanceFunction with a pattern defined to accept Strings that define an Integer followed by a separator followed by a Double.

Method Detail

setParameters

public String[] setParameters(String[] args)
                       throws ParameterException
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<O extends RealVector<O,?>,P extends Preprocessor<O>,D extends CorrelationDistance<D>>
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[])

valueOf

public D valueOf(String pattern)
                                         throws IllegalArgumentException
Provides a distance suitable to this DistanceFunction based on the given pattern.

Parameters:
pattern - A pattern defining a distance suitable to this DistanceFunction
Returns:
a distance suitable to this DistanceFunction based on the given pattern
Throws:
IllegalArgumentException - if the given pattern is not compatible with the requirements of this DistanceFunction

infiniteDistance

public D infiniteDistance()
Provides an infinite distance.

Returns:
an infinite distance

nullDistance

public D nullDistance()
Provides a null distance.

Returns:
a null distance

undefinedDistance

public D undefinedDistance()
Provides an undefined distance.

Returns:
an undefined distance

correlationDistance

D correlationDistance(O dv1,
                      O dv2)
Description copied from class: AbstractCorrelationDistanceFunction
Computes the correlation distance between the two specified vectors.

Specified by:
correlationDistance in class AbstractCorrelationDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>,D extends CorrelationDistance<D>>
Parameters:
dv1 - first RealVector
dv2 - second RealVector
Returns:
the correlation distance between the two specified vectors
See Also:
AbstractCorrelationDistanceFunction.correlationDistance(de.lmu.ifi.dbs.elki.data.RealVector, de.lmu.ifi.dbs.elki.data.RealVector)

correlationDistance

public int correlationDistance(LocalPCA<O> pca1,
                               LocalPCA<O> pca2,
                               int dimensionality)
Computes the correlation distance between the two subspaces defined by the specified PCAs.

Parameters:
pca1 - first PCA
pca2 - second PCA
dimensionality - the dimensionality of the data space
Returns:
the correlation distance between the two subspaces defined by the specified PCAs

adjust

private void adjust(Matrix v,
                    Matrix e_czech,
                    Matrix vector,
                    int corrDim)
Inserts the specified vector into the given orthonormal matrix v at column corrDim. After insertion the matrix v is orthonormalized and column corrDim of matrix e_czech is set to the corrDim-th unit vector..

Parameters:
v - the orthonormal matrix of the eigenvectors
e_czech - the selection matrix of the strong eigenvectors
vector - the vector to be inserted
corrDim - the column at which the vector should be inserted

euclideanDistance

private double euclideanDistance(O dv1,
                                 O dv2)
Computes the Euklidean distance between the given two vectors.

Parameters:
dv1 - first NumberVector
dv2 - second NumberVector
Returns:
the Euklidean distance between the given two vectors

getDefaultPreprocessorClassName

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

Specified by:
getDefaultPreprocessorClassName in class AbstractCorrelationDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>,D extends CorrelationDistance<D>>

getPreprocessorClassDescription

String getPreprocessorClassDescription()
Returns the description for parameter preprocessor.

Specified by:
getPreprocessorClassDescription in class AbstractCorrelationDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>,D extends CorrelationDistance<D>>

getPreprocessorSuperClassName

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

Specified by:
getPreprocessorSuperClassName in class AbstractCorrelationDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>,D extends CorrelationDistance<D>>

getAssociationID

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

Specified by:
getAssociationID in class AbstractCorrelationDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>,D extends CorrelationDistance<D>>

Release 0.1 (2008-07-10_1838)