Documentation of 'smile.math.distance.MahalanobisDistance' Java class
MahalanobisDistance
smile.math.distance

Class MahalanobisDistance

  • All Implemented Interfaces:
    java.io.Serializable, Distance<double[]>, Metric<double[]>


    public class MahalanobisDistance
    extends java.lang.Object
    implements Metric<double[]>, java.io.Serializable
    In statistics, Mahalanobis distance is based on correlations between variables by which different patterns can be identified and analyzed. It is a useful way of determining similarity of an unknown sample set to a known one. It differs from Euclidean distance in that it takes into account the correlations of the data set and is scale-invariant, i.e. not dependent on the scale of measurements.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      MahalanobisDistance(double[][] cov)
      Constructor with given covariance matrix.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double d(double[] x, double[] y)
      Returns the distance measure between two objects.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MahalanobisDistance

        public MahalanobisDistance(double[][] cov)
        Constructor with given covariance matrix.
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • d

        public double d(double[] x,
                        double[] y)
        Description copied from interface: Distance
        Returns the distance measure between two objects.
        Specified by:
        d in interface Distance<double[]>

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.