@Reference(authors="R. Connor, F. A. Cardillo, L. Vadicamo, F. Rabitti", title="Hilbert Exclusion: Improved Metric Search through Finite Isometric Embeddings", booktitle="arXiv preprint arXiv:1604.08640", url="http://arxiv.org/abs/1604.08640", bibkey="DBLP:journals/corr/ConnorCVR16") public class TriangularDistanceFunction extends TriangularDiscriminationDistanceFunction
\[\text{Triangular-Distance}(\vec{x},\vec{y}):=\sqrt{ \sum\nolimits_i \tfrac{|x_i-y_i|^2}{x_i+y_i}}\]
This distance function is meant for distribution vectors that sum to 1, and does not work on negative values.
This differs from TriangularDistanceFunction
simply by the square
root, which makes it a proper metric and a good approximation for the much
more expensive SqrtJensenShannonDivergenceDistanceFunction
.
Reference:
R. Connor, F. A. Cardillo, L. Vadicamo, F. Rabitti
Hilbert Exclusion: Improved Metric Search through Finite Isometric
Embeddings
arXiv preprint arXiv:1604.08640
TODO: support sparse vectors, varying length
Modifier and Type | Class and Description |
---|---|
static class |
TriangularDistanceFunction.Parameterizer
Parameterization class, using the static instance.
|
Modifier and Type | Field and Description |
---|---|
static TriangularDistanceFunction |
STATIC
Static instance.
|
Modifier | Constructor and Description |
---|---|
private |
TriangularDistanceFunction()
Deprecated.
|
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) |
int |
hashCode() |
boolean |
isMetric()
Is this distance function metric (satisfy the triangle inequality)
|
boolean |
isSquared()
Squared distances, that would become metric after square root.
|
double |
minDist(SpatialComparable mbr1,
SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this distance
function.
|
java.lang.String |
toString() |
dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, getInputTypeRestriction
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
instantiate
getInputTypeRestriction
isSymmetric
public static final TriangularDistanceFunction STATIC
@Deprecated private TriangularDistanceFunction()
STATIC
instead.public double distance(NumberVector v1, NumberVector v2)
PrimitiveDistanceFunction
distance
in interface NumberVectorDistanceFunction<NumberVector>
distance
in interface PrimitiveDistanceFunction<NumberVector>
distance
in class TriangularDiscriminationDistanceFunction
v1
- first DatabaseObjectv2
- second DatabaseObjectpublic double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
SpatialPrimitiveDistanceFunction
minDist
in interface SpatialPrimitiveDistanceFunction<NumberVector>
minDist
in class TriangularDiscriminationDistanceFunction
mbr1
- the first MBR objectmbr2
- the second MBR objectpublic boolean isSquared()
DistanceFunction
isSquared
in interface DistanceFunction<NumberVector>
isSquared
in class TriangularDiscriminationDistanceFunction
true
when squared.public boolean isMetric()
DistanceFunction
true
when metric.public java.lang.String toString()
toString
in class TriangularDiscriminationDistanceFunction
public boolean equals(java.lang.Object obj)
equals
in class TriangularDiscriminationDistanceFunction
public int hashCode()
hashCode
in class TriangularDiscriminationDistanceFunction
Copyright © 2019 ELKI Development Team. License information.