Package ai.libs.jaicore.basic.metric
Class EuclideanDistance
- java.lang.Object
-
- ai.libs.jaicore.basic.metric.EuclideanDistance
-
- All Implemented Interfaces:
org.api4.java.common.math.IMetric<double[]>,IDistanceMetric
public class EuclideanDistance extends java.lang.Object implements IDistanceMetric
Implementation of the Euclidean distance for time series. The Euclidean distance for two time seriesAandBof lengthnis defined as\sqrt{\sum_{i=0}^{n} (A_i - B_i)^2 }. Therefore, it is required forAandBto be of the same length.
-
-
Constructor Summary
Constructors Constructor Description EuclideanDistance()
-
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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.api4.java.common.metric.IDistanceMetric
getDistance
-
-
-
-
Method Detail
-
distance
public double distance(double[] a, double[] b)Description copied from interface:IDistanceMetricCalculates the distance between two time series.- Specified by:
distancein interfaceIDistanceMetric- Parameters:
a- First time series.b- Second time series.- Returns:
- Distance between the first and second time series.
-
-