|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcbr.similarity.EuclideanDistanceMetric
public class EuclideanDistanceMetric
Provides implementation for a Euclidean Distance Metric. The following formula is used:
Similarity = 1 - (|value1 - value2| / MAX_VALUE)
Which produces a normalised, inverted similarity value between two values.
Constructor Summary | |
---|---|
EuclideanDistanceMetric(double max)
Creates a Euclidean Distance Metric given a value for the maximum distance between two values. |
Method Summary | |
---|---|
double |
compare(Feature f1,
Feature f2)
Derives the normalised, inverted 1-dimensional Euclidean distance between two numerical feature values |
double |
getMax()
Returns the maximum value, used in the equation for this metric. |
void |
setMax(double max)
Specify the maximum difference between two numerical values |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EuclideanDistanceMetric(double max)
max
- the maximum value between two feature valuesMethod Detail |
---|
public double getMax()
public void setMax(double max)
max
- the maximum valuepublic double compare(Feature f1, Feature f2)
compare
in interface SimilarityMetric
f1
- a case featuref2
- another case feature
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |