de.lmu.ifi.dbs.elki.distance.distancefunction.timeseries
Class LCSSDistanceFunction<V extends NumberVector<V,?>>
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,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDoubleDistanceFunction<V>
de.lmu.ifi.dbs.elki.distance.distancefunction.timeseries.LCSSDistanceFunction<V>
- Type Parameters:
V
- the type of NumberVector to compute the distances in between
- All Implemented Interfaces:
- DistanceFunction<V,DoubleDistance>, MeasurementFunction<V,DoubleDistance>, Parameterizable
public class LCSSDistanceFunction<V extends NumberVector<V,?>>
- extends AbstractDoubleDistanceFunction<V>
Provides the Longest Common Subsequence distance for NumberVectors.
Adapted for Java, based on Matlab Code by Michalis Vlachos. Original
Copyright Notice:
BEGIN COPYRIGHT NOTICE
lcsMatching code -- (c) 2002 Michalis Vlachos
(http://www.cs.ucr.edu/~mvlachos)
This code is provided as is, with no guarantees except that bugs are almost
surely present. Published reports of research using this code (or a modified
version) should cite the article that describes the algorithm:
M. Vlachos, M. Hadjieleftheriou, D. Gunopulos, E. Keogh:"Indexing Multi-Dimensional Time-Series with Support for Multiple Distance Measures"
, In Proc. of 9th SIGKDD, Washington, DC, 2003
Comments and bug reports are welcome. Email to mvlachos@cs.ucr.edu I would
also appreciate hearing about how you used this code, improvements that you
have made to it.
You are free to modify, extend or distribute this code, as long as this
copyright notice is included whole and unchanged.
END COPYRIGHT NOTICE
- Author:
- Thomas Bernecker
Constructor Summary |
LCSSDistanceFunction()
Provides a Longest Common Subsequence distance function that can compute
the Dynamic Time Warping distance (that is a DoubleDistance) for
NumberVectors. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PDELTA_ID
public static final OptionID PDELTA_ID
- OptionID for
PDELTA_PARAM
PEPSILON_ID
public static final OptionID PEPSILON_ID
- OptionID for
PEPSILON_PARAM
PDELTA_PARAM
private final DoubleParameter PDELTA_PARAM
- PDELTA parameter
PEPSILON_PARAM
private final DoubleParameter PEPSILON_PARAM
- PEPSILON parameter
pDelta
private double pDelta
- Keeps the currently set pDelta.
pEpsilon
private double pEpsilon
- Keeps the currently set pEpsilon.
LCSSDistanceFunction
public LCSSDistanceFunction()
- Provides a Longest Common Subsequence distance function that can compute
the Dynamic Time Warping distance (that is a DoubleDistance) for
NumberVectors.
distance
public DoubleDistance distance(V v1,
V v2)
- Provides the Longest Common Subsequence distance between the given two
vectors.
- Parameters:
v1
- first DatabaseObjectv2
- second DatabaseObject
- Returns:
- the Longest Common Subsequence distance between the given two
vectors as an instance of
DoubleDistance
.
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<V extends NumberVector<V,?>,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