Package weka.core

Class ManhattanDistance

All Implemented Interfaces:
Serializable, DistanceFunction, OptionHandler, RevisionHandler, TechnicalInformationHandler

public class ManhattanDistance extends NormalizableDistance implements TechnicalInformationHandler
Implements the Manhattan distance (or Taxicab geometry). The distance between two points is the sum of the (absolute) differences of their coordinates.

For more information, see:

Wikipedia. Taxicab geometry. URL http://en.wikipedia.org/wiki/Taxicab_geometry.

BibTeX:

 @misc{missing_id,
    author = {Wikipedia},
    title = {Taxicab geometry},
    URL = {http://en.wikipedia.org/wiki/Taxicab_geometry}
 }
 

Valid options are:

 -D
  Turns off the normalization of attribute 
  values in distance calculation.
 -R <col1,col2-col4,...>
  Specifies list of columns to used in the calculation of the 
  distance. 'first' and 'last' are valid indices.
  (default: first-last)
 -V
  Invert matching sense of column indices.
Version:
$Revision: 8034 $
Author:
Fracpete (fracpete at waikato dot ac dot nz)
See Also:
  • Constructor Details

    • ManhattanDistance

      public ManhattanDistance()
      Constructs an Manhattan Distance object, Instances must be still set.
    • ManhattanDistance

      public ManhattanDistance(Instances data)
      Constructs an Manhattan Distance object and automatically initializes the ranges.
      Parameters:
      data - the instances the distance function should work on
  • Method Details

    • globalInfo

      public String globalInfo()
      Returns a string describing this object.
      Specified by:
      globalInfo in class NormalizableDistance
      Returns:
      a description of the evaluator suitable for displaying in the explorer/experimenter gui
    • getTechnicalInformation

      public TechnicalInformation getTechnicalInformation()
      Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
      Specified by:
      getTechnicalInformation in interface TechnicalInformationHandler
      Returns:
      the technical information about this class
    • getRevision

      public String getRevision()
      Returns the revision string.
      Specified by:
      getRevision in interface RevisionHandler
      Returns:
      the revision