Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction.correlation
Class AbstractPreferenceVectorBasedCorrelationDistanceFunction<V extends RealVector<V,?>,P extends PreferenceVectorPreprocessor<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,D>
                      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.AbstractCorrelationDistanceFunction<V,P,PreferenceVectorBasedCorrelationDistance>
                          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.AbstractPreferenceVectorBasedCorrelationDistanceFunction<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,PreferenceVectorBasedCorrelationDistance>, MeasurementFunction<V,PreferenceVectorBasedCorrelationDistance>, PreprocessorBasedMeasurementFunction<V,P,PreferenceVectorBasedCorrelationDistance>, PreprocessorClient<P,V>, Parameterizable
Direct Known Subclasses:
DiSHDistanceFunction, HiSCDistanceFunction

public abstract class AbstractPreferenceVectorBasedCorrelationDistanceFunction<V extends RealVector<V,?>,P extends PreferenceVectorPreprocessor<V>>
extends AbstractCorrelationDistanceFunction<V,P,PreferenceVectorBasedCorrelationDistance>

Abstract super class for all preference vector based correlation distance functions.

Author:
Arthur Zimek

Field Summary
private  double epsilon
          Holds the value of EPSILON_PARAM.
static OptionID EPSILON_ID
          OptionID for EPSILON_PARAM
private  DoubleParameter EPSILON_PARAM
          Parameter to specify the maximum distance between two vectors with equal preference vectors 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.distancefunction.correlation.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, logger
 
Constructor Summary
AbstractPreferenceVectorBasedCorrelationDistanceFunction()
          Provides a preference vector based CorrelationDistanceFunction, adding parameter EPSILON_PARAM to the option handler additionally to parameters of super class.
 
Method Summary
protected  PreferenceVectorBasedCorrelationDistance correlationDistance(V v1, V v2)
          Computes the correlation distance between the two specified vectors.
abstract  PreferenceVectorBasedCorrelationDistance correlationDistance(V v1, V v2, BitSet pv1, BitSet pv2)
          Computes the correlation distance between the two specified vectors according to the specified preference vectors.
private  int dimensionality()
          Returns the dimensionality of the database.
 AssociationID<?> getAssociationID()
          Returns the association ID for the association to be set by the preprocessor.
 double getEpsilon()
          Returns epsilon.
 String getPreprocessorDescription()
          Returns the description for the preprocessor parameter.
 Class<P> getPreprocessorSuperClass()
          Returns the super class for the preprocessor parameter.
 PreferenceVectorBasedCorrelationDistance infiniteDistance()
          Provides an infinite distance.
 PreferenceVectorBasedCorrelationDistance nullDistance()
          Provides a null distance.
 List<String> setParameters(List<String> args)
          Calls the super method and sets additionally the value of the parameter EPSILON_PARAM.
 PreferenceVectorBasedCorrelationDistance undefinedDistance()
          Provides an undefined distance.
 PreferenceVectorBasedCorrelationDistance valueOf(String pattern)
          Provides a measurement suitable to this measurement function based on the given pattern.
 double weightedDistance(Integer id1, Integer id2, BitSet weightVector)
          Computes the weighted distance between the two specified vectors according to the given preference vector.
 double weightedDistance(V v1, V v2, BitSet weightVector)
          Computes the weighted distance between the two specified vectors according to the given preference vector.
 double weightedPrefereneceVectorDistance(Integer id1, Integer id2)
          Computes the weighted distance between the two specified data vectors according to their preference vectors.
 double weightedPrefereneceVectorDistance(V v1, V v2)
          Computes the weighted distance between the two specified data vectors according to their preference vectors.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.AbstractCorrelationDistanceFunction
distance, shortDescription
 
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, 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.preprocessing.PreprocessorClient
getDefaultPreprocessorClassName
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters
 

Field Detail

EPSILON_ID

public static final OptionID EPSILON_ID
OptionID for EPSILON_PARAM


EPSILON_PARAM

private final DoubleParameter EPSILON_PARAM
Parameter to specify the maximum distance between two vectors with equal preference vectors before considering them as parallel, must be a double equal to or greater than 0.

Default value: 0.001

Key: -pvbasedcorrelationdf.epsilon


epsilon

private double epsilon
Holds the value of EPSILON_PARAM.

Constructor Detail

AbstractPreferenceVectorBasedCorrelationDistanceFunction

public AbstractPreferenceVectorBasedCorrelationDistanceFunction()
Provides a preference vector based CorrelationDistanceFunction, adding parameter EPSILON_PARAM to the option handler additionally to parameters of super class.

Method Detail

valueOf

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

Returns:
an infinite distance

nullDistance

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

Returns:
a null distance

undefinedDistance

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

Returns:
an undefined distance

correlationDistance

protected PreferenceVectorBasedCorrelationDistance correlationDistance(V v1,
                                                                       V v2)
Description copied from class: AbstractCorrelationDistanceFunction
Computes the correlation distance between the two specified vectors.

Specified by:
correlationDistance in class AbstractCorrelationDistanceFunction<V extends RealVector<V,?>,P extends PreferenceVectorPreprocessor<V>,PreferenceVectorBasedCorrelationDistance>
Parameters:
v1 - first RealVector
v2 - second RealVector
Returns:
the correlation distance between the two specified vectors

correlationDistance

public abstract PreferenceVectorBasedCorrelationDistance correlationDistance(V v1,
                                                                             V v2,
                                                                             BitSet pv1,
                                                                             BitSet pv2)
Computes the correlation distance between the two specified vectors according to the specified preference vectors.

Parameters:
v1 - first RealVector
v2 - second RealVector
pv1 - the first preference vector
pv2 - the second preference vector
Returns:
the correlation distance between the two specified vectors

weightedDistance

public double weightedDistance(V v1,
                               V v2,
                               BitSet weightVector)
Computes the weighted distance between the two specified vectors according to the given preference vector.

Parameters:
v1 - the first vector
v2 - the second vector
weightVector - the preference vector
Returns:
the weighted distance between the two specified vectors according to the given preference vector

weightedDistance

public double weightedDistance(Integer id1,
                               Integer id2,
                               BitSet weightVector)
Computes the weighted distance between the two specified vectors according to the given preference vector.

Parameters:
id1 - the id of the first vector
id2 - the id of the second vector
weightVector - the preference vector
Returns:
the weighted distance between the two specified vectors according to the given preference vector

weightedPrefereneceVectorDistance

public double weightedPrefereneceVectorDistance(V v1,
                                                V v2)
Computes the weighted distance between the two specified data vectors according to their preference vectors.

Parameters:
v1 - the first vector
v2 - the the second vector
Returns:
the weighted distance between the two specified vectors according to the preference vector of the first data vector

weightedPrefereneceVectorDistance

public double weightedPrefereneceVectorDistance(Integer id1,
                                                Integer id2)
Computes the weighted distance between the two specified data vectors according to their preference vectors.

Parameters:
id1 - the id of the first vector
id2 - the id of the second vector
Returns:
the weighted distance between the two specified vectors according to the preference vector of the first data vector

setParameters

public List<String> setParameters(List<String> args)
                           throws ParameterException
Calls the super method and sets additionally the value of the parameter EPSILON_PARAM.

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractPreprocessorBasedDistanceFunction<V extends RealVector<V,?>,P extends PreferenceVectorPreprocessor<V>,PreferenceVectorBasedCorrelationDistance>
Parameters:
args - parameters to set the attributes accordingly to
Returns:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting

getEpsilon

public double getEpsilon()
Returns epsilon.

Returns:
epsilon

getAssociationID

public final AssociationID<?> getAssociationID()
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.PREFERENCE_VECTOR

getPreprocessorSuperClass

public final 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 PreferenceVectorPreprocessor

getPreprocessorDescription

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

Returns:
the description for the preprocessor parameter

dimensionality

private int dimensionality()
Returns the dimensionality of the database.

Returns:
the dimensionality of the database, -1 if no database is assigned.

Release 0.2.1 (2009-07-13_1605)