Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction.correlation
Class PCABasedCorrelationDistanceFunction<V extends NumberVector<V,?>,P extends LocalPCAPreprocessor<V>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      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,D>
                  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.AbstractCorrelationDistanceFunction<V,P,PCACorrelationDistance>
                      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.PCABasedCorrelationDistanceFunction<V,P>
Type Parameters:
V - the type of NumberVector to compute the distances in between
P - the type of Preprocessor used
All Implemented Interfaces:
DistanceFunction<V,PCACorrelationDistance>, LocalPCAPreprocessorBasedDistanceFunction<V,P,PCACorrelationDistance>, PreprocessorBasedDistanceFunction<V,P,PCACorrelationDistance>, MeasurementFunction<V,PCACorrelationDistance>, PreprocessorBasedMeasurementFunction<V,P,PCACorrelationDistance>, PreprocessorClient<P,V>, Parameterizable

public class PCABasedCorrelationDistanceFunction<V extends NumberVector<V,?>,P extends LocalPCAPreprocessor<V>>
extends AbstractCorrelationDistanceFunction<V,P,PCACorrelationDistance>
implements LocalPCAPreprocessorBasedDistanceFunction<V,P,PCACorrelationDistance>

Provides the correlation distance for real valued vectors.

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 of a distance between a vector q and a given space that indicates that q adds a new dimension to the space, must be a double equal to or greater than 0.
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
distanceFactory
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
PCABasedCorrelationDistanceFunction(Parameterization config)
          Constructor, adhering to Parameterizable
 
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(PCAFilteredResult pca1, PCAFilteredResult pca2, int dimensionality)
          Computes the correlation distance between the two subspaces defined by the specified PCAs.
protected  PCACorrelationDistance correlationDistance(V dv1, V dv2)
          Computes the correlation distance between the two specified vectors.
private  double euclideanDistance(V dv1, V dv2)
          Computes the Euclidean distance between the given two vectors.
 AssociationID<?> getAssociationID()
          Returns the association ID for the association to be set by the preprocessor.
 Class<?> getDefaultPreprocessorClass()
          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.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.AbstractCorrelationDistanceFunction
distance
 
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
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
getDatabase, getDistanceFactory, infiniteDistance, nullDistance, undefinedDistance, valueOf
 
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.distancefunction.DistanceFunction
distance, distance, distance
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction
getDistanceFactory, infiniteDistance, nullDistance, setDatabase, undefinedDistance, valueOf
 

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 of a distance between a vector q and a given space that indicates that q adds a new dimension to the space, must be a double equal to or greater than 0.

Default value: 0.25

Key: -pcabasedcorrelationdf.delta


delta

private double delta
Holds the value of DELTA_PARAM.

Constructor Detail

PCABasedCorrelationDistanceFunction

public PCABasedCorrelationDistanceFunction(Parameterization config)
Constructor, adhering to Parameterizable

Parameters:
config - Parameterization
Method Detail

correlationDistance

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

Specified by:
correlationDistance in class AbstractCorrelationDistanceFunction<V extends NumberVector<V,?>,P extends LocalPCAPreprocessor<V>,PCACorrelationDistance>
Parameters:
dv1 - first vector
dv2 - second vector
Returns:
the correlation distance between the two specified vectors

correlationDistance

public int correlationDistance(PCAFilteredResult pca1,
                               PCAFilteredResult 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(V dv1,
                                 V dv2)
Computes the Euclidean distance between the given two vectors.

Parameters:
dv1 - first FeatureVector
dv2 - second FeatureVector
Returns:
the Euclidean distance between the given two vectors

getDefaultPreprocessorClass

public Class<?> getDefaultPreprocessorClass()
Description copied from interface: PreprocessorClient
Returns the name of the default preprocessor.

Specified by:
getDefaultPreprocessorClass in interface PreprocessorClient<P extends LocalPCAPreprocessor<V>,V extends NumberVector<V,?>>
Returns:
the name of the default preprocessor, which is KnnQueryBasedLocalPCAPreprocessor

getPreprocessorDescription

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

Specified by:
getPreprocessorDescription in interface PreprocessorClient<P extends LocalPCAPreprocessor<V>,V extends NumberVector<V,?>>
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.

Specified by:
getPreprocessorSuperClass in interface PreprocessorClient<P extends LocalPCAPreprocessor<V>,V extends NumberVector<V,?>>
Returns:
the super class for the preprocessor parameter, which is LocalPCAPreprocessor

getAssociationID

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

Specified by:
getAssociationID in interface PreprocessorClient<P extends LocalPCAPreprocessor<V>,V extends NumberVector<V,?>>
Returns:
the association ID for the association to be set by the preprocessor, which is AssociationID.LOCAL_PCA

Release 0.3 (2010-03-31_1612)