@Priority(value=200) @Reference(authors="G. N. Lance, W. T. Williams", title="Computer Programs for Hierarchical Polythetic Classification (Similarity Analyses)", booktitle="Computer Journal, Volume 9, Issue 1", url="https://doi.org/10.1093/comjnl/9.1.60", bibkey="doi:10.1093/comjnl/9.1.60") @Alias(value="canberra") public class CanberraDistanceFunction extends java.lang.Object implements SpatialPrimitiveDistanceFunction<NumberVector>, NumberVectorDistanceFunction<NumberVector>
Canberra distance is defined as: \[ \text{Canberra}(\vec{x},\vec{y}) := \sum\nolimits_i \tfrac{|x_i-y_i|}{|x_i|+|y_i|} \]
Reference:
G. N. Lance, W. T. Williams
Computer Programs for Hierarchical Polythetic Classification ("Similarity
Analyses")
In: Computer Journal, Volume 9, Issue 1
Modifier and Type | Class and Description |
---|---|
static class |
CanberraDistanceFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
static CanberraDistanceFunction |
STATIC
Static instance.
|
Modifier | Constructor and Description |
---|---|
protected |
CanberraDistanceFunction()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(NumberVector v1,
NumberVector v2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
boolean |
equals(java.lang.Object obj) |
SimpleTypeInformation<? super NumberVector> |
getInputTypeRestriction()
Get the input data type of the function.
|
int |
hashCode() |
boolean |
isMetric()
Is this distance function metric (satisfy the triangle inequality)
|
double |
minDist(SpatialComparable mbr1,
SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this distance
function.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
instantiate
isSquared, isSymmetric
public static final CanberraDistanceFunction STATIC
public double distance(NumberVector v1, NumberVector v2)
PrimitiveDistanceFunction
distance
in interface NumberVectorDistanceFunction<NumberVector>
distance
in interface PrimitiveDistanceFunction<NumberVector>
v1
- first DatabaseObjectv2
- second DatabaseObjectpublic double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
SpatialPrimitiveDistanceFunction
minDist
in interface SpatialPrimitiveDistanceFunction<NumberVector>
mbr1
- the first MBR objectmbr2
- the second MBR objectpublic boolean isMetric()
DistanceFunction
isMetric
in interface DistanceFunction<NumberVector>
true
when metric.public SimpleTypeInformation<? super NumberVector> getInputTypeRestriction()
DistanceFunction
getInputTypeRestriction
in interface DistanceFunction<NumberVector>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<NumberVector>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2019 ELKI Development Team. License information.