smile.math.distance
Class JensenShannonDistance
- java.lang.Object
-
- smile.math.distance.JensenShannonDistance
-
public class JensenShannonDistance extends java.lang.Object implements Metric<double[]>, java.io.Serializable
The Jensen-Shannon divergence is a popular method of measuring the similarity between two probability distributions. It is also known as information radius or total divergence to the average.The Jensen-Shannon divergence is a symmetrized and smoothed version of the Kullback-Leibler divergence . It is defined by
J(P||Q) = (D(P||M) + D(Q||M)) / 2
where M = (P+Q)/2 and D(·||·) is KL divergence. Different from the Kullback-Leibler divergence, it is always a finite value.
The square root of the Jensen-Shannon divergence is a metric, which is calculated by this class.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description JensenShannonDistance()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubled(double[] x, double[] y)Returns the distance measure between two objects.java.lang.StringtoString()
-
DataMelt 3.0 © DataMelt by jWork.ORG