# Package smile.math.distance

package smile.math.distance
Distance and metric measures. A distance function maps pairs of points into the non-negative reals and has to satisfy
• non-negativity: `d(x, y) >= 0`
• isolation: `d(x, y) = 0` if and only if `x = y`
• symmetry: `d(x, y) = d(x, y)`
Note that a distance function is not required to satisfy triangular inequality `|x - y| + |y - z| >= |x - z|`, which is necessary for a metric.
• Class
Description
Chebyshev distance (or Tchebychev distance), or L metric is a metric defined on a vector space where the distance between two vectors is the greatest of their differences along any coordinate dimension.
Correlation distance is defined as 1 - correlation coefficient.
An interface to calculate a distance measure between two objects.
Dynamic time warping is an algorithm for measuring similarity between two sequences which may vary in time or speed.
The Edit distance between two strings is a metric for measuring the amount of difference between two sequences.
Euclidean distance.
In information theory, the Hamming distance between two strings of equal length is the number of positions for which the corresponding symbols are different.
The Jaccard index, also known as the Jaccard similarity coefficient is a statistic used for comparing the similarity and diversity of sample sets.
The Jensen-Shannon divergence is a popular method of measuring the similarity between two probability distributions.
In coding theory, the Lee distance is a distance between two strings `x1x2...xn` and `y1y2...yn` of equal length n over the q-ary alphabet `{0, 1, ..., q-1}` of size `q >= 2`, defined as
In statistics, Mahalanobis distance is based on correlations between variables by which different patterns can be identified and analyzed.
Manhattan distance, also known as L1 distance or L1 norm, is the sum of the (absolute) differences of their coordinates.
A metric function defines a distance between elements of a set.
Minkowski distance of order p or Lp-norm, is a generalization of Euclidean distance that is actually L2-norm.
Chebyshev distance (or Tchebychev distance), or L metric is a metric defined on a vector space where the distance between two vectors is the greatest of their differences along any coordinate dimension.
Euclidean distance on sparse arrays.
Manhattan distance, also known as L1 distance or L1 norm, is the sum of the (absolute) differences of their coordinates.
Minkowski distance of order p or Lp-norm, is a generalization of Euclidean distance that is actually L2-norm.