Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel
Class FooKernelFunction<O extends FeatureVector<?,?>>

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.similarityfunction.kernel.AbstractKernelFunction<O,DoubleDistance>
                      extended by de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.AbstractDoubleKernelFunction<O>
                          extended by de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.FooKernelFunction<O>
Type Parameters:
O - vector type
All Implemented Interfaces:
DistanceFunction<O,DoubleDistance>, MeasurementFunction<O,DoubleDistance>, KernelFunction<O,DoubleDistance>, SimilarityFunction<O,DoubleDistance>, Parameterizable

public class FooKernelFunction<O extends FeatureVector<?,?>>
extends AbstractDoubleKernelFunction<O>

Provides an experimental KernelDistanceFunction for RealVectors. Currently only supports 2D data and x1^2 ~ x2 correlations.

Author:
Simon Paradies

Field Summary
static int DEFAULT_MAX_DEGREE
          The default max_degree.
private  int max_degree
          Degree of the polynomial kernel function
static OptionID MAX_DEGREE_ID
          OptionID for MAX_DEGREE_PARAM
private  IntParameter MAX_DEGREE_PARAM
          Parameter for the maximum degree
 
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
FooKernelFunction()
          Provides a polynomial Kernel function that computes a similarity between the two vectors V1 and V2 definded by (V1^T*V2)^max_degree
 
Method Summary
 List<String> setParameters(List<String> args)
          Grabs all specified options from the option handler.
 String shortDescription()
          Returns the required input pattern.
 DoubleDistance similarity(O o1, O o2)
          Provides an experimental kernel similarity between the given two vectors.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.AbstractDoubleKernelFunction
distance, infiniteDistance, nullDistance, undefinedDistance, valueOf
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.AbstractKernelFunction
similarity, similarity
 
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, setDatabase, 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.distancefunction.DistanceFunction
distance, distance
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction
isInfiniteDistance, isNullDistance, isUndefinedDistance, requiredInputPattern, setDatabase
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters
 

Field Detail

DEFAULT_MAX_DEGREE

public static final int DEFAULT_MAX_DEGREE
The default max_degree.

See Also:
Constant Field Values

MAX_DEGREE_ID

public static final OptionID MAX_DEGREE_ID
OptionID for MAX_DEGREE_PARAM


MAX_DEGREE_PARAM

private final IntParameter MAX_DEGREE_PARAM
Parameter for the maximum degree


max_degree

private int max_degree
Degree of the polynomial kernel function

Constructor Detail

FooKernelFunction

public FooKernelFunction()
Provides a polynomial Kernel function that computes a similarity between the two vectors V1 and V2 definded by (V1^T*V2)^max_degree

Method Detail

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<O extends FeatureVector<?,?>,DoubleDistance>
Returns:
Description of the class

setParameters

public List<String> setParameters(List<String> args)
                           throws ParameterException
Description copied from class: AbstractParameterizable
Grabs all specified options from the option handler. Any extending class should call this method first and return the returned array without further changes, but after setting further required parameters. An example for overwriting this method taking advantage from the previously (in superclasses) defined options would be:

 {
   List remainingParameters = super.setParameters(args);
   // set parameters for your class
   // for example like this:
   if(isSet(MY_PARAM_VALUE_PARAM))
   {
      myParamValue = getParameterValue(MY_PARAM_VALUE_PARAM);
   }
   .
   .
   .
   return remainingParameters;
   // or in case of attributes requesting parameters themselves
   // return parameterizableAttribbute.setParameters(remainingParameters);
 }
 

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractParameterizable
Parameters:
args - parameters to set the attributes accordingly to
Returns:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting

similarity

public DoubleDistance similarity(O o1,
                                 O o2)
Provides an experimental kernel similarity between the given two vectors.

Parameters:
o1 - first vector
o2 - second vector
Returns:
the experimental kernel similarity between the given two vectors as an instance of DoubleDistance.

Release 0.2 (2009-07-06_1820)