nz.ac.waikato.mcennis.rat.graph.algorithm.reusablecores.distance
Class CosineDistance

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.graph.algorithm.reusablecores.distance.CosineDistance
All Implemented Interfaces:
DistanceFunction

public class CosineDistance
extends java.lang.Object
implements DistanceFunction

Adapted from Anna Huang's distance metric for Weka by Daniel McEnnis


Constructor Summary
CosineDistance()
           
 
Method Summary
 double distance(DataVector inst1, DataVector inst2)
          Return the distance between the two given vectors as a double.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CosineDistance

public CosineDistance()
Method Detail

distance

public double distance(DataVector inst1,
                       DataVector inst2)
Description copied from interface: DistanceFunction
Return the distance between the two given vectors as a double.

Specified by:
distance in interface DistanceFunction
Parameters:
inst1 - left data vector
inst2 - right data vector
Returns:
distance by a given metric