Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction.subspace
Class SubspaceDistanceFunction<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,SubspaceDistance>
                      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.subspace.SubspaceDistanceFunction<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,SubspaceDistance>, MeasurementFunction<V,SubspaceDistance>, PreprocessorBasedMeasurementFunction<V,P,SubspaceDistance>, PreprocessorClient<P,V>, Parameterizable

public class SubspaceDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>>
extends AbstractPreprocessorBasedDistanceFunction<V,P,SubspaceDistance>

Provides a distance function to determine a kind of correlation distance between two points, which is a pair consisting of the distance between the two subspaces spanned by the strong eigenvectors of the two points and the affine distance between the two subspaces.

Author:
Elke Achtert

Field Summary
 
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
SubspaceDistanceFunction()
          Provides a distance function to determine distances between subspaces of equal dimensionality.
 
Method Summary
 SubspaceDistance distance(V o1, V o2)
          Note, that the pca of o1 must have equal ore more strong eigenvectors than the pca of o2.
 SubspaceDistance distance(V o1, V o2, 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.
 SubspaceDistance infiniteDistance()
          Provides an infinite distance.
 SubspaceDistance nullDistance()
          Provides a null distance.
 String shortDescription()
          Returns the required input pattern.
 SubspaceDistance undefinedDistance()
          Provides an undefined distance.
 SubspaceDistance 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, setParameters
 
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, 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
 

Constructor Detail

SubspaceDistanceFunction

public SubspaceDistanceFunction()
Provides a distance function to determine distances between subspaces of equal dimensionality.

Method Detail

getDefaultPreprocessorClassName

public String getDefaultPreprocessorClassName()
Description copied from interface: PreprocessorClient
Returns the name of the default preprocessor.

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

getPreprocessorDescription

public final 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, 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 SubspaceDistance 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 SubspaceDistance infiniteDistance()
Description copied from interface: MeasurementFunction
Provides an infinite distance.

Returns:
an infinite distance

nullDistance

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

Returns:
a null distance

undefinedDistance

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

Returns:
an undefined distance

distance

public SubspaceDistance 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

distance

public SubspaceDistance distance(V o1,
                                 V o2,
                                 PCAFilteredResult pca1,
                                 PCAFilteredResult pca2)
Computes the distance between two given DatabaseObjects according to this distance function. Note, that the first pca must have an equal number of 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

shortDescription

public String shortDescription()
Description copied from class: AbstractMeasurementFunction
Returns the required input pattern.

Specified by:
shortDescription in interface Parameterizable
Overrides:
shortDescription in class AbstractMeasurementFunction<V extends RealVector<V,?>,SubspaceDistance>
Returns:
Description of the class

Release 0.2 (2009-07-06_1820)