de.lmu.ifi.dbs.elki.distance.distancefunction.timeseries
Class LCSSDistanceFunction

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.timeseries.LCSSDistanceFunction
All Implemented Interfaces:
DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable

@Title(value="Longest Common Subsequence distance function")
@Reference(authors="M. Vlachos, M. Hadjieleftheriou, D. Gunopulos, E. Keogh",
           title="Indexing Multi-Dimensional Time-Series with Support for Multiple Distance Measures",
           booktitle="Proceedings of the ninth ACM SIGKDD international conference on Knowledge discovery and data mining",
           url="http://dx.doi.org/10.1145/956750.956777")
public class LCSSDistanceFunction
extends AbstractVectorDoubleDistanceFunction

Provides the Longest Common Subsequence distance for FeatureVectors. 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


Nested Class Summary
static class LCSSDistanceFunction.Parameterizer
          Parameterization class.
 
Field Summary
private  double pDelta
          Keeps the currently set pDelta.
static OptionID PDELTA_ID
          PDELTA parameter
private  double pEpsilon
          Keeps the currently set pEpsilon.
static OptionID PEPSILON_ID
          PEPSILON parameter
 
Constructor Summary
LCSSDistanceFunction(double pDelta, double pEpsilon)
          Constructor.
 
Method Summary
 double doubleDistance(NumberVector<?,?> v1, NumberVector<?,?> v2)
          Provides the Longest Common Subsequence distance between the given two vectors.
 boolean equals(Object obj)
           
 VectorFieldTypeInformation<? super NumberVector<?,?>> getInputTypeRestriction()
          Get the input data type of the function.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
distance, getDistanceFactory
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction
instantiate, isMetric, isSymmetric
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
instantiate, isMetric, isSymmetric
 

Field Detail

PDELTA_ID

public static final OptionID PDELTA_ID
PDELTA parameter


PEPSILON_ID

public static final OptionID PEPSILON_ID
PEPSILON parameter


pDelta

private double pDelta
Keeps the currently set pDelta.


pEpsilon

private double pEpsilon
Keeps the currently set pEpsilon.

Constructor Detail

LCSSDistanceFunction

public LCSSDistanceFunction(double pDelta,
                            double pEpsilon)
Constructor.

Parameters:
pDelta - pDelta
pEpsilon - pEpsilon
Method Detail

doubleDistance

public double doubleDistance(NumberVector<?,?> v1,
                             NumberVector<?,?> v2)
Provides the Longest Common Subsequence distance between the given two vectors.

Parameters:
v1 - first Object
v2 - second Object
Returns:
the Longest Common Subsequence distance between the given two vectors as an instance of DoubleDistance.

getInputTypeRestriction

public VectorFieldTypeInformation<? super NumberVector<?,?>> getInputTypeRestriction()
Description copied from interface: DistanceFunction
Get the input data type of the function.

Specified by:
getInputTypeRestriction in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>
Specified by:
getInputTypeRestriction in interface PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
Overrides:
getInputTypeRestriction in class AbstractVectorDoubleDistanceFunction
Returns:
Type restriction

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Release 0.4.0 (2011-09-20_1324)