Documentation of 'jhpro.nnet.jknnl.MinkowskiMetric' Java class
MinkowskiMetric
jhpro.nnet.jknnl

Class MinkowskiMetric

  • All Implemented Interfaces:
    MetricModel


    public class MinkowskiMetric
    extends java.lang.Object
    implements MetricModel
    Minkowski metric return distance calculated by function: {sum[(x_i - y_i)^p]}^(1/p)
    • Constructor Summary

      Constructors 
      Constructor and Description
      MinkowskiMetric(double p)
      Creates a new instance of MinkowskiMetrics.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double getDistance(double[] firstVector, double[] secondVector)
      Return distance between input vectors.
      double[] getParamateres()
      Return array of parameters containing p
      void setParameteres(double[] paramateresList)
      Set parameter p
      • Methods inherited from class java.lang.Object

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

      • MinkowskiMetric

        public MinkowskiMetric(double p)
        Creates a new instance of MinkowskiMetrics. Default value of the parameter p is 1
        Parameters:
        p - metrics parameter
    • Method Detail

      • setParameteres

        public void setParameteres(double[] paramateresList)
        Set parameter p
        Parameters:
        paramateresList - array of parameter
      • getParamateres

        public double[] getParamateres()
        Return array of parameters containing p
        Returns:
        array of parameter containing p
      • getDistance

        public double getDistance(double[] firstVector,
                                  double[] secondVector)
        Return distance between input vectors. firstVector vector and secondVector must have the same size otherwise function return -1 d = {sum[(x_i - y_i)^p]}^(1/p)
        Specified by:
        getDistance in interface MetricModel
        Parameters:
        firstVector - first input vector
        secondVector - second input vector
        Returns:
        distance between vectors

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.