O
- Vector type@Reference(authors="P. Jaccard", title="Distribution de la florine alpine dans la Bassin de Dranses et dans quelques regiones voisines", booktitle="Bulletin del la Soci\u00e9t\u00e9 Vaudoise des Sciences Naturelles") public class JaccardSimilarityDistanceFunction<O extends FeatureVector<?>> extends AbstractSetDistanceFunction<O> implements NormalizedPrimitiveSimilarityFunction<O>, NumberVectorDistanceFunction<O>, PrimitiveDistanceFunction<O>
|intersection|/|union|
.
We can extend this definition as follows:
|non-zero and equal attributes|/|non-zero attributes|
.
For binary vectors, this will obviously be the same quantity. However, this
version is more useful for categorical data.
Reference:
P. Jaccard
Distribution de la florine alpine dans la Bassin de Dranses et dans quelques
regiones voisines
Bulletin del la Société Vaudoise des Sciences Naturelles
DOUBLE_NULL, INTEGER_NULL, STRING_NULL
Constructor and Description |
---|
JaccardSimilarityDistanceFunction()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(NumberVector o1,
NumberVector o2)
Computes the distance between two given vectors according to this distance
function.
|
double |
distance(O o1,
O o2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
SimpleTypeInformation<? super O> |
getInputTypeRestriction()
Get the input data type of the function.
|
<T extends O> |
instantiate(Relation<T> relation)
Instantiate with a database to get the actual distance query.
|
boolean |
isMetric()
Is this distance function metric (in particular, does it satisfy the
triangle equation?)
|
double |
similarity(O o1,
O o2)
Computes the similarity between two given DatabaseObjects according to this
similarity function.
|
static double |
similarityNumberVector(NumberVector o1,
NumberVector o2)
Compute Jaccard similarity for two number vectors.
|
isNull
isSymmetric
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isSymmetric
isSymmetric
public JaccardSimilarityDistanceFunction()
public double similarity(O o1, O o2)
PrimitiveSimilarityFunction
similarity
in interface PrimitiveSimilarityFunction<O extends FeatureVector<?>>
o1
- first DatabaseObjecto2
- second DatabaseObjectpublic static double similarityNumberVector(NumberVector o1, NumberVector o2)
o1
- First vectoro2
- Second vectorpublic double distance(O o1, O o2)
PrimitiveDistanceFunction
distance
in interface PrimitiveDistanceFunction<O extends FeatureVector<?>>
distance
in class AbstractPrimitiveDistanceFunction<O extends FeatureVector<?>>
o1
- first DatabaseObjecto2
- second DatabaseObjectpublic double distance(NumberVector o1, NumberVector o2)
NumberVectorDistanceFunction
distance
in interface NumberVectorDistanceFunction<O extends FeatureVector<?>>
o1
- first DatabaseObjecto2
- second DatabaseObjectpublic boolean isMetric()
DistanceFunction
isMetric
in interface DistanceFunction<O extends FeatureVector<?>>
isMetric
in class AbstractPrimitiveDistanceFunction<O extends FeatureVector<?>>
true
when metric.public SimpleTypeInformation<? super O> getInputTypeRestriction()
SimilarityFunction
getInputTypeRestriction
in interface DistanceFunction<O extends FeatureVector<?>>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<O extends FeatureVector<?>>
getInputTypeRestriction
in interface PrimitiveSimilarityFunction<O extends FeatureVector<?>>
getInputTypeRestriction
in interface SimilarityFunction<O extends FeatureVector<?>>
public <T extends O> DistanceSimilarityQuery<T> instantiate(Relation<T> relation)
AbstractPrimitiveDistanceFunction
instantiate
in interface DistanceFunction<O extends FeatureVector<?>>
instantiate
in interface SimilarityFunction<O extends FeatureVector<?>>
instantiate
in class AbstractPrimitiveDistanceFunction<O extends FeatureVector<?>>
relation
- RepresentationCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.