com.rapidminer.tools.math.similarity.numerical
Class JaccardNumericalSimilarity

java.lang.Object
  extended by com.rapidminer.tools.math.similarity.DistanceMeasure
      extended by com.rapidminer.tools.math.similarity.SimilarityMeasure
          extended by com.rapidminer.tools.math.similarity.numerical.JaccardNumericalSimilarity
All Implemented Interfaces:
java.io.Serializable

public class JaccardNumericalSimilarity
extends SimilarityMeasure

A variant of the Jaccard coefficient defined for numeric attributes.

Author:
Michael Wurst
See Also:
Serialized Form

Constructor Summary
JaccardNumericalSimilarity()
           
 
Method Summary
 double calculateDistance(double[] value1, double[] value2)
          This method does the calculation of the distance between two double arrays.
 double calculateSimilarity(double[] value1, double[] value2)
          This method does the similarity of the distance between two double arrays.
 void init(ExampleSet exampleSet)
          Before using a similarity measure, it is needed to initialise.
 
Methods inherited from class com.rapidminer.tools.math.similarity.SimilarityMeasure
isDistance
 
Methods inherited from class com.rapidminer.tools.math.similarity.DistanceMeasure
calculateDistance, calculateDistance, calculateSimilarity, calculateSimilarity, init, init, isSimilarity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaccardNumericalSimilarity

public JaccardNumericalSimilarity()
Method Detail

calculateSimilarity

public double calculateSimilarity(double[] value1,
                                  double[] value2)
Description copied from class: DistanceMeasure
This method does the similarity of the distance between two double arrays. The meanings of the double values might be remembered from the init method.

Specified by:
calculateSimilarity in class DistanceMeasure
Returns:
the distance

calculateDistance

public double calculateDistance(double[] value1,
                                double[] value2)
Description copied from class: DistanceMeasure
This method does the calculation of the distance between two double arrays. The meanings of the double values might be remembered from the init method.

Specified by:
calculateDistance in class DistanceMeasure
Returns:
the distance

init

public void init(ExampleSet exampleSet)
          throws OperatorException
Description copied from class: DistanceMeasure
Before using a similarity measure, it is needed to initialise. Subclasses might use initialising for remembering the exampleset properties like attribute type or test if applicable to exampleSet at all. Please note that it might be necessary to also override the other init methods if this measrue should make use of parameters or other IOObjects.

Specified by:
init in class DistanceMeasure
Parameters:
exampleSet - the exampleset
Throws:
OperatorException


Copyright © 2001-2009 by Rapid-I