com.rapidminer.tools.math.similarity.numerical
Class DTWDistance
java.lang.Object
com.rapidminer.tools.math.similarity.DistanceMeasure
com.rapidminer.tools.math.similarity.numerical.DTWDistance
- All Implemented Interfaces:
- java.io.Serializable
public class DTWDistance
- extends DistanceMeasure
A distance measure based on "Dynamic Time Warping". The DTW distance is mapped to a similarity measure using f(x)= 1 - (x / (1 + x)). Feature
weights are also supported.
- Author:
- Piotr Kasprzak, Sebastian Land
- See Also:
- Serialized Form
|
Method Summary |
double |
calculateDistance(double[] value1,
double[] value2)
This method does the calculation of the distance between two double arrays. |
double |
calculateSimilarity(double[] value1,
double[] value2)
This method does the similarity of the distance between two double arrays. |
void |
init(ExampleSet exampleSet)
Before using a similarity measure, it is needed to initialize. |
protected double |
pointDistance(int i,
int j,
double[] ts1,
double[] ts2)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DTWDistance
public DTWDistance()
pointDistance
protected double pointDistance(int i,
int j,
double[] ts1,
double[] ts2)
calculateDistance
public double calculateDistance(double[] value1,
double[] value2)
- Description copied from class:
DistanceMeasure
- This method does the calculation of the distance between two double arrays. The meanings of
the double values might be remembered from the init method.
- Specified by:
calculateDistance in class DistanceMeasure
- Returns:
- the distance
calculateSimilarity
public double calculateSimilarity(double[] value1,
double[] value2)
- Description copied from class:
DistanceMeasure
- This method does the similarity of the distance between two double arrays. The meanings of
the double values might be remembered from the init method.
- Specified by:
calculateSimilarity in class DistanceMeasure
- Returns:
- the distance
init
public void init(ExampleSet exampleSet)
throws OperatorException
- Description copied from class:
DistanceMeasure
- Before using a similarity measure, it is needed to initialize. Subclasses might use initializing
for remembering the exampleset properties like attribute type or test if applicable to exampleSet at all.
Please note that it might be necessary to also override the other init methods if this measure should make
use of parameters or other IOObjects.
- Specified by:
init in class DistanceMeasure
- Parameters:
exampleSet - the exampleset
- Throws:
OperatorException
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Copyright © 2001-2009 by Rapid-I