de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel
Class ArbitraryKernelFunctionWrapper<O extends RealVector<O,?>>
java.lang.Object
de.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,D>
de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.AbstractKernelFunction<O,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.AbstractDoubleKernelFunction<O>
de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.ArbitraryKernelFunctionWrapper<O>
- All Implemented Interfaces:
- DistanceFunction<O,DoubleDistance>, MeasurementFunction<O,DoubleDistance>, KernelFunction<O,DoubleDistance>, SimilarityFunction<O,DoubleDistance>, Loggable, Parameterizable
public class ArbitraryKernelFunctionWrapper<O extends RealVector<O,?>>
- extends AbstractDoubleKernelFunction<O>
Provides a wrapper for arbitrary kernel functions whose kernel matrix has been precomputed.
- Author:
- Simon Paradies
Constructor Summary |
ArbitraryKernelFunctionWrapper()
Provides a wrapper for arbitrary kernel functions whose kernel matrix has already been precomputed. |
Method Summary |
String |
description()
Returns a description of the class and the required parameters. |
DoubleDistance |
distance(Integer id1,
Integer id2)
Returns the distance between the two objects specified by their object ids. |
DoubleDistance |
distance(O o1,
O o2)
Returns the distance between the two specified objects. |
void |
setDatabase(Database<O> database,
boolean verbose,
boolean time)
Set the database that holds the associations for the DatabaseObject for
which the measurements should be computed. |
DoubleDistance |
similarity(O o1,
O o2)
Provides a wrapper for arbitrary kernel functions whose kernel matrix has already been precomputed. |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
addOption, checkGlobalParameterConstraints, deleteOption, description, description, getAttributeSettings, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters, 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 |
kernelMatrix
private KernelMatrix<O extends RealVector<O,?>> kernelMatrix
- The global kernel Matrix.
ArbitraryKernelFunctionWrapper
public ArbitraryKernelFunctionWrapper()
- Provides a wrapper for arbitrary kernel functions whose kernel matrix has already been precomputed.
similarity
public DoubleDistance similarity(O o1,
O o2)
- Provides a wrapper for arbitrary kernel functions whose kernel matrix has already been precomputed.
Returns the value that is stored in the kernel matrix which itself is stored in the database.
- Parameters:
o1
- first vectoro2
- second vector
- Returns:
- the linear kernel similarity which is stored in the Global Database
- See Also:
DistanceFunction.distance(de.lmu.ifi.dbs.elki.data.DatabaseObject, de.lmu.ifi.dbs.elki.data.DatabaseObject)
distance
public DoubleDistance distance(O o1,
O o2)
- Returns the distance between the two specified objects.
- Specified by:
distance
in interface DistanceFunction<O extends RealVector<O,?>,DoubleDistance>
- Overrides:
distance
in class AbstractDoubleKernelFunction<O extends RealVector<O,?>>
- Parameters:
o1
- first DatabaseObjecto2
- second DatabaseObject
- Returns:
- the distance between the two objcts specified by their obejct ids
- See Also:
DistanceFunction.distance(DatabaseObject, DatabaseObject)
distance
public DoubleDistance distance(Integer id1,
Integer id2)
- Returns the distance between the two objects specified by their object ids.
- Specified by:
distance
in interface DistanceFunction<O extends RealVector<O,?>,DoubleDistance>
- Overrides:
distance
in class AbstractDistanceFunction<O extends RealVector<O,?>,DoubleDistance>
- Parameters:
id1
- first object idid2
- second object id
- Returns:
- the distance between the two objects specified by their object ids
description
public String description()
- Description copied from interface:
Parameterizable
- Returns a description of the class and the required parameters.
This description should be suitable for a usage description as for a standalone application.
- Specified by:
description
in interface Parameterizable
- Overrides:
description
in class AbstractParameterizable
- Returns:
- String a description of the class and the required parameters
- See Also:
Parameterizable.description()
setDatabase
public void setDatabase(Database<O> database,
boolean verbose,
boolean time)
- Description copied from interface:
MeasurementFunction
- Set the database that holds the associations for the DatabaseObject for
which the measurements should be computed.
- Specified by:
setDatabase
in interface MeasurementFunction<O extends RealVector<O,?>,DoubleDistance>
- Overrides:
setDatabase
in class AbstractMeasurementFunction<O extends RealVector<O,?>,DoubleDistance>
- Parameters:
database
- the database to be setverbose
- flag to allow verbose messages while performing the methodtime
- flag to request output of performance time- See Also:
MeasurementFunction.setDatabase(de.lmu.ifi.dbs.elki.database.Database, boolean, boolean)