|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<O,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDoubleDistanceFunction<O>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractLocallyWeightedDistanceFunction<V,P>
de.lmu.ifi.dbs.elki.distance.distancefunction.KernelBasedLocallyWeightedDistanceFunction<V,P>
V
- the type of RealVector to compute the distances in betweenP
- the type of Preprocessor usedpublic class KernelBasedLocallyWeightedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>>
Provides a kernel based locally weighted distance function. It is defined as follows: result = max{distP(P,Q), distQ(Q,P)}, where distP(P,Q) computes the quadratic form distance on the weak eigenvectors of the kernel matrix of P between two vectors P and Q in feature space. Computation of the distance component of the weak eigenvectors is done indirectly by computing the difference between the complete kernel distance and the distance component of the strong eigenvectors: distP(P,Q) = distP_weak(P,Q) = sqrt(distP_complete(P,Q)^2 - distP_strong(P,Q)^2) KP_complete(P,Q) is the kernel derived distance between P and Q. The distance component of the strong eigenvectors KP_strong(P,Q) is computed as follows: First, the vectors P and Q are projected onto the strong eigenvectors of the kernel matrix of P, which results in the two vectors Pp and Qp. Then, the euclidean distance is used to compute the distance between Pp and Qp. In case of the linear kernel function, this distance is identical to those computed by the LocallyWeightedDistanceFunction with parameters big = 1.0 and small = 0.0
Field Summary | |
---|---|
static String |
DEFAULT_KERNEL_FUNCTION_CLASS
The default kernel function. |
static OptionID |
KERNEL_FUNCTION_ID
OptionID for KERNEL_FUNCTION_PARAM |
(package private) ClassParameter<KernelFunction<V,DoubleDistance>> |
KERNEL_FUNCTION_PARAM
Parameter for the kernel function |
private KernelFunction<V,DoubleDistance> |
kernelFunction
The kernel function that is used. |
private KernelMatrix<V> |
kernelMatrix
The global precomputed kernel matrix |
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 | |
---|---|
KernelBasedLocallyWeightedDistanceFunction()
Provides a kernel based locally weighted distance function. |
Method Summary | |
---|---|
private double |
computeDistance(V v1,
V v2)
Computes the distance between two given real vectors according to this distance function. |
DoubleDistance |
distance(V v1,
V v2)
Computes the distance between two given DatabaseObjects according to this distance function. |
AssociationID<Matrix> |
getAssociationID()
Returns the association ID for the association to be set by the preprocessor. |
void |
setDatabase(Database<V> database,
boolean verbose,
boolean time)
Set the database that holds the associations for the DatabaseObject for which the measurements should be computed. |
List<String> |
setParameters(List<String> args)
Calls AbstractParameterizable#setParameters and passes the remaining
parameters to the AbstractLocallyWeightedDistanceFunction.preprocessorHandler . |
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractLocallyWeightedDistanceFunction |
---|
getDefaultPreprocessorClassName, getPreprocessorDescription, getPreprocessorSuperClass, shortDescription |
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDoubleDistanceFunction |
---|
infiniteDistance, nullDistance, undefinedDistance, valueOf |
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.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, collectOptions, getParameters |
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction |
---|
requiredInputPattern |
Field Detail |
---|
public static final String DEFAULT_KERNEL_FUNCTION_CLASS
public static final OptionID KERNEL_FUNCTION_ID
KERNEL_FUNCTION_PARAM
ClassParameter<KernelFunction<V extends RealVector<V,?>,DoubleDistance>> KERNEL_FUNCTION_PARAM
private KernelFunction<V extends RealVector<V,?>,DoubleDistance> kernelFunction
private KernelMatrix<V extends RealVector<V,?>> kernelMatrix
Constructor Detail |
---|
public KernelBasedLocallyWeightedDistanceFunction()
Method Detail |
---|
public DoubleDistance distance(V v1, V v2)
v1
- first DatabaseObjectv2
- second DatabaseObject
public List<String> setParameters(List<String> args) throws ParameterException
AbstractLocallyWeightedDistanceFunction
AbstractParameterizable#setParameters
and passes the remaining
parameters to the AbstractLocallyWeightedDistanceFunction.preprocessorHandler
.
setParameters
in interface Parameterizable
setParameters
in class AbstractLocallyWeightedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>>
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingprivate double computeDistance(V v1, V v2)
v1
- first FeatureVectorv2
- second FeatureVector
public void setDatabase(Database<V> database, boolean verbose, boolean time)
MeasurementFunction
setDatabase
in interface MeasurementFunction<V extends RealVector<V,?>,DoubleDistance>
setDatabase
in class AbstractLocallyWeightedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>>
database
- Databaseverbose
- unusedtime
- unusedpublic AssociationID<Matrix> getAssociationID()
AssociationID.STRONG_EIGENVECTOR_MATRIX
.
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |