Package ai.libs.jaicore.ml.tsc.distances
Class DerivateTransformDistance
- java.lang.Object
-
- ai.libs.jaicore.ml.tsc.distances.DerivateTransformDistance
-
- All Implemented Interfaces:
ITimeSeriesDistance
public class DerivateTransformDistance extends java.lang.Object implements ITimeSeriesDistance
Implementation of the Derivate Transform Distance (TD) measure as published in "Non-isometric transforms in time series classification using DTW" by Tomasz Gorecki and Maciej Luczak (2014). As the name suggests, with the Derivate Transform Distance the author combine their previously approaches of @see DerivateDistance and @see TransformDistance. Given a distance measured, the Derivate Transform Distance for the two time seriesAandBis:a * d(A, B) + b * d(A', B') + c * d(t(A), t(B)), whereA'andB'are the derivates (@see jaicore.ml.tsc.filter.derivate) andt(A)andt(B)are transforms (@see jaicore.ml.tsc.filter.transform) ofAandBrespec. and0 <= a <= 1, 0 <= b <= 1, 0 <= c <= 1>are parameters of the measure. The Derivate Transform Distance that uses Dynamic Time Warping as underlying distance measure is commonly denoted as DTD_DTW. The Derivate Transform Distance that uses the Euclidean distance as underlying distance measure is commonly denoted as TD_ED.It is also possible to use a distinct distance measure to calculate the distance between the time series, its transforms and its derivates.
-
-
Constructor Summary
Constructors Constructor Description DerivateTransformDistance(double a, double b, double c, ITimeSeriesDistance distance)Constructor that uses the same distance measures for function, derivate and transform values.DerivateTransformDistance(double a, double b, double c, ITimeSeriesDistance timeSeriesDistance, ITimeSeriesDistance derivateDistance, ITimeSeriesDistance transformDistance)Constructor with individual distance measure for function, derivate and transform values that uses theBackwardDifferencetransformas derivate and theCosineTransformas transformation.DerivateTransformDistance(double a, double b, double c, ADerivateFilter derivate, ATransformFilter transform, ITimeSeriesDistance distance)Constructor that uses the same distance measures for function, derivate and transform values.DerivateTransformDistance(double a, double b, double c, ADerivateFilter derivate, ATransformFilter transform, ITimeSeriesDistance timeSeriesDistance, ITimeSeriesDistance derivateDistance, ITimeSeriesDistance transformDistance)Constructor with individual distance measure for function, derivate and transform values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledistance(double[] a, double[] b)Calculates the distance between two time series.doublegetA()Getter for theaparameter.doublegetB()Getter for thebparameter.doublegetC()Getter for thecparameter.voidsetA(double a)Sets theaparameter.voidsetB(double b)Sets thebparameter.voidsetC(double c)Sets thecparameter.
-
-
-
Constructor Detail
-
DerivateTransformDistance
public DerivateTransformDistance(double a, double b, double c, ADerivateFilter derivate, ATransformFilter transform, ITimeSeriesDistance timeSeriesDistance, ITimeSeriesDistance derivateDistance, ITimeSeriesDistance transformDistance)Constructor with individual distance measure for function, derivate and transform values.- Parameters:
a- Determines the influence of distance of the derivate values to the overall distance measure.b- Determines the influence of distance of the transform values to the overall distance measure.c- Determines the influence of distance of the transform values to the overall distance measure.derivate- The derivate calculation to use.transform- The transform calculation to use.timeSeriesDistance- The distance measure to use to calculate the distance of the function values.derivateDistance- The distance measure to use to calculate the distance of the derivate values.transformDistance- The distance measure to use to calculate the distance of the transform values.
-
DerivateTransformDistance
public DerivateTransformDistance(double a, double b, double c, ITimeSeriesDistance timeSeriesDistance, ITimeSeriesDistance derivateDistance, ITimeSeriesDistance transformDistance)Constructor with individual distance measure for function, derivate and transform values that uses theBackwardDifferencetransformas derivate and theCosineTransformas transformation.- Parameters:
a- Determines the influence of distance of the derivate values to the overall distance measure.b- Determines the influence of distance of the transform values to the overall distance measure.c- Determines the influence of distance of the transform values to the overall distance measure.timeSeriesDistance- The distance measure to use to calculate the distance of the function values.derivateDistance- The distance measure to use to calculate the distance of the derivate values.transformDistance- The distance measure to use to calculate the distance of the transform values.
-
DerivateTransformDistance
public DerivateTransformDistance(double a, double b, double c, ADerivateFilter derivate, ATransformFilter transform, ITimeSeriesDistance distance)Constructor that uses the same distance measures for function, derivate and transform values.- Parameters:
a- Determines the influence of distance of the derivate values to the overall distance measure.b- Determines the influence of distance of the transform values to the overall distance measure.c- Determines the influence of distance of the transform values to the overall distance measure.derivate- The derivate calculation to use.transform- The transform calculation to use.distance- The distance measure to use of the function, derivate and transform values.
-
DerivateTransformDistance
public DerivateTransformDistance(double a, double b, double c, ITimeSeriesDistance distance)Constructor that uses the same distance measures for function, derivate and transform values.- Parameters:
a- Determines the influence of distance of the derivate values to the overall distance measure.b- Determines the influence of distance of the transform values to the overall distance measure.c- Determines the influence of distance of the transform values to the overall distance measure.distance- The distance measure to use of the function, derivate and transform values.
-
-
Method Detail
-
distance
public double distance(double[] a, double[] b)Description copied from interface:ITimeSeriesDistanceCalculates the distance between two time series.- Specified by:
distancein interfaceITimeSeriesDistance- Parameters:
a- First time series.b- Second time series.- Returns:
- Distance between the first and second time series.
-
setA
public void setA(double a)
Sets theaparameter. @see #a- Parameters:
a- Theaparameter,0 <= a <= 1.
-
setB
public void setB(double b)
Sets thebparameter. @see #b- Parameters:
a- Thebparameter,0 <= b <= 1.
-
setC
public void setC(double c)
Sets thecparameter. @see #c- Parameters:
a- Thecparameter,0 <= c <= 1.
-
getA
public double getA()
Getter for theaparameter. @see #a
-
getB
public double getB()
Getter for thebparameter. @see #b
-
getC
public double getC()
Getter for thecparameter. @see #c
-
-