Package ai.libs.jaicore.ml.tsc.distances
Class MoveSplitMerge
- java.lang.Object
-
- ai.libs.jaicore.ml.tsc.distances.MoveSplitMerge
-
- All Implemented Interfaces:
ITimeSeriesDistance
public class MoveSplitMerge extends java.lang.Object implements ITimeSeriesDistance
Implementation of the Move-Split-Merge (MSM) measure as published in "The Move-Split-Merge Metric for Time Series" by Alexandra Stefan, Vassilis Athitsos and Gautam Das (2013). The idea behind the MSM metric is to define a set of operations that can be used to transform any time series into any other.- A Move operation changes the value of a single point of the time series.
- A Split operation splits a single point of the time series into two consecutive points that have the same value as the original point.
- A Merge operation merges two consecutive points that have the same value int a single point that has that value.
xtoyis|x-y|. The cost for a Split and Merge is defined by a constantc. LetS = (s_1, s_2, .., s_n)be a sequence of Move/Split/Merge operations withs_ieither Move, Split or a Merge. The Move-Split-Merge distance between to time seriesAandBis defined be the cost of the lowest-cost transformationS*, such thattransform(S*, A) = B.
-
-
Constructor Summary
Constructors Constructor Description MoveSplitMerge(double c)Constructor.
-
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.
-
-
-
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.
-
-