Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

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,PreferenceVectorBasedCorrelationDistance>
                          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.PreferenceVectorBasedCorrelationDistanceFunction<O,P>
All Implemented Interfaces:
DistanceFunction<O,PreferenceVectorBasedCorrelationDistance>, MeasurementFunction<O,PreferenceVectorBasedCorrelationDistance>, Loggable, Parameterizable
Direct Known Subclasses:
DiSHDistanceFunction, HiSCDistanceFunction

public abstract class PreferenceVectorBasedCorrelationDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>>
extends AbstractCorrelationDistanceFunction<O,P,PreferenceVectorBasedCorrelationDistance>

XXX unify CorrelationDistanceFunction and VarianceDistanceFunction

Author:
Arthur Zimek

Field Summary
static AssociationID ASSOCIATION_ID
          The Assocoiation ID for the association to be set by the preprocessor.
static double DEFAULT_EPSILON
          The default value for epsilon.
private  double epsilon
          Holds the value of epsilon parameter.
static String EPSILON_D
          Description for parameter epsilon.
static String EPSILON_P
          Option string for parameter epsilon.
static Class<PreferenceVectorPreprocessor> 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
PreferenceVectorBasedCorrelationDistanceFunction()
          Provides a preference vector based CorrelationDistanceFunction.
 
Method Summary
protected  PreferenceVectorBasedCorrelationDistance correlationDistance(O v1, O v2)
          Computes the correlation distance between the two specified vectors.
abstract  PreferenceVectorBasedCorrelationDistance correlationDistance(O v1, O v2, BitSet pv1, BitSet pv2)
          Computes the correlation distance between the two specified vectors according to the specified preference vectors.
(package private)  AssociationID getAssociationID()
          Returns the assocoiation ID for the association to be set by the preprocessor.
 double getEpsilon()
          Returns epsilon.
(package private)  Class<PreferenceVectorPreprocessor> getPreprocessorSuperClassName()
          Returns the super class for the preprocessor.
 PreferenceVectorBasedCorrelationDistance infiniteDistance()
          Provides an infinite distance.
 PreferenceVectorBasedCorrelationDistance nullDistance()
          Provides a null distance.
 String[] setParameters(String[] args)
          Sets the values for the parameters delta and preprocessor if specified.
 PreferenceVectorBasedCorrelationDistance undefinedDistance()
          Provides an undefined distance.
 PreferenceVectorBasedCorrelationDistance valueOf(String pattern)
          Provides a distance suitable to this DistanceFunction 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(O dv1, O dv2, 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(O rv1, O rv2)
          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.AbstractCorrelationDistanceFunction
description, distance, getDefaultPreprocessorClassName, getPreprocessorClassDescription
 
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<PreferenceVectorPreprocessor> PREPROCESSOR_SUPER_CLASS
The super class for the preprocessor.


DEFAULT_EPSILON

public static final double DEFAULT_EPSILON
The default value for epsilon.

See Also:
Constant Field Values

EPSILON_P

public static final String EPSILON_P
Option string for parameter epsilon.

See Also:
Constant Field Values

EPSILON_D

public static String EPSILON_D
Description for parameter epsilon.


epsilon

private double epsilon
Holds the value of epsilon parameter.

Constructor Detail

PreferenceVectorBasedCorrelationDistanceFunction

public PreferenceVectorBasedCorrelationDistanceFunction()
Provides a preference vector based CorrelationDistanceFunction.

Method Detail

valueOf

public PreferenceVectorBasedCorrelationDistance 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 PreferenceVectorBasedCorrelationDistance infiniteDistance()
Provides an infinite distance.

Returns:
an infinite distance

nullDistance

public PreferenceVectorBasedCorrelationDistance nullDistance()
Provides a null distance.

Returns:
a null distance

undefinedDistance

public PreferenceVectorBasedCorrelationDistance undefinedDistance()
Provides an undefined distance.

Returns:
an undefined distance

correlationDistance

protected PreferenceVectorBasedCorrelationDistance correlationDistance(O v1,
                                                                       O v2)
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>,PreferenceVectorBasedCorrelationDistance>
Parameters:
v1 - first RealVector
v2 - 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 abstract PreferenceVectorBasedCorrelationDistance correlationDistance(O v1,
                                                                             O 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(O dv1,
                               O dv2,
                               BitSet weightVector)
Computes the weighted distance between the two specified vectors according to the given preference vector.

Parameters:
dv1 - the first vector
dv2 - 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(O rv1,
                                                O rv2)
Computes the weighted distance between the two specified data vectors according to their preference vectors.

Parameters:
rv1 - the first vector
rv2 - 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 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>,PreferenceVectorBasedCorrelationDistance>
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[])

getEpsilon

public double getEpsilon()
Returns epsilon.

Returns:
epsilon

getAssociationID

final 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>,PreferenceVectorBasedCorrelationDistance>

getPreprocessorSuperClassName

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

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

Release 0.1 (2008-07-10_1838)