Documentation of 'jsat.linear.distancemetrics.ManhattanDistance' Java class
ManhattanDistance
jsat.linear.distancemetrics

Class ManhattanDistance

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      ManhattanDistance clone() 
      double dist(double summaryConst, Vec main, Vec target)
      Efficiently computes the distance from one main vector that is used many times, to some sparse target vector.
      double dist(Vec a, Vec b)
      Computes the distance between 2 vectors.
      double getVectorConstant(Vec vec)
      Computes a summary constant value for the vector that is based on the distance metric in use.
      boolean isIndiscemible()
      Returns true if this distance metric obeys the rule that, for any x and y ∈ S
      d(x, y) = 0 if and only if x = y
      boolean isSubadditive()
      Returns true if this distance metric obeys the rule that, for any x, y, and z ∈ S
      d(x, z) ≤ d(x, y) + d(y, z)
      boolean isSymmetric()
      Returns true if this distance metric obeys the rule that, for any x, y, and z ∈ S
      d(x, y) = d(y, x)
      double metricBound()
      All metrics must return values greater than or equal to 0.
      java.lang.String toString()
      Returns a descriptive name of the Distance Metric in use
      • Methods inherited from class java.lang.Object

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

      • ManhattanDistance

        public ManhattanDistance()
    • Method Detail

      • dist

        public double dist(Vec a,
                           Vec b)
        Description copied from interface: DistanceMetric
        Computes the distance between 2 vectors. The smaller the value, the closer, and there for, more similar, the vectors are. 0 indicates the vectors are the same.
        Specified by:
        dist in interface DistanceMetric
        Parameters:
        a - the first vector
        b - the second vector
        Returns:
        the distance between them
      • isSymmetric

        public boolean isSymmetric()
        Description copied from interface: DistanceMetric
        Returns true if this distance metric obeys the rule that, for any x, y, and z ∈ S
        d(x, y) = d(y, x)
        Specified by:
        isSymmetric in interface DistanceMetric
        Returns:
        true if this distance metric is symmetric, false if it is not
      • isSubadditive

        public boolean isSubadditive()
        Description copied from interface: DistanceMetric
        Returns true if this distance metric obeys the rule that, for any x, y, and z ∈ S
        d(x, z) ≤ d(x, y) + d(y, z)
        Specified by:
        isSubadditive in interface DistanceMetric
        Returns:
        true if this distance metric supports the triangle inequality, false if it does not.
      • isIndiscemible

        public boolean isIndiscemible()
        Description copied from interface: DistanceMetric
        Returns true if this distance metric obeys the rule that, for any x and y ∈ S
        d(x, y) = 0 if and only if x = y
        Specified by:
        isIndiscemible in interface DistanceMetric
        Returns:
        true if this distance metric is indicemible, false otherwise.
      • metricBound

        public double metricBound()
        Description copied from interface: DistanceMetric
        All metrics must return values greater than or equal to 0. The upper bound on the value returned is different for different metrics. This method returns the theoretical maximal value that could be returned by this distance metric. That means Double.POSITIVE_INFINITY is a valid return value.
        Specified by:
        metricBound in interface DistanceMetric
        Returns:
        the maximal distance for any two points in that could exist by this distance metric.
      • toString

        public java.lang.String toString()
        Description copied from interface: DistanceMetric
        Returns a descriptive name of the Distance Metric in use
        Specified by:
        toString in interface DistanceMetric
        Overrides:
        toString in class java.lang.Object
        Returns:
        the name of this metric
      • getVectorConstant

        public double getVectorConstant(Vec vec)
        Description copied from interface: DenseSparseMetric
        Computes a summary constant value for the vector that is based on the distance metric in use. This value will be used to perform efficient dense to sparse computations.
        Specified by:
        getVectorConstant in interface DenseSparseMetric
        Parameters:
        vec - the vector that will be used in many distance computations
        Returns:
        the summary value for the vector

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.