Package elki.similarity.cluster
Class ClusterJaccardSimilarity
- java.lang.Object
-
- elki.similarity.cluster.ClusterJaccardSimilarity
-
- All Implemented Interfaces:
Distance<Cluster<?>>
,PrimitiveDistance<Cluster<?>>
,PrimitiveSimilarity<Cluster<?>>
,Similarity<Cluster<?>>
@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", url="http://data.rero.ch/01-R241574160", bibkey="journals/misc/Jaccard1902") public class ClusterJaccardSimilarity extends java.lang.Object implements PrimitiveDistance<Cluster<?>>, PrimitiveSimilarity<Cluster<?>>
Measure the similarity of clusters via the Jaccard coefficient.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- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClusterJaccardSimilarity.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description static ClusterJaccardSimilarity
STATIC
Static instance.
-
Constructor Summary
Constructors Constructor Description ClusterJaccardSimilarity()
Constructor - use the static instanceSTATIC
!
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(Cluster<?> o1, Cluster<?> o2)
Computes the distance between two given DatabaseObjects according to this distance function.SimpleTypeInformation<? super Cluster<?>>
getInputTypeRestriction()
Get the input data type of the function.<T extends Cluster<?>>
DistanceSimilarityQuery<T>instantiate(Relation<T> relation)
Instantiate with a database to get the actual distance query.boolean
isMetric()
Is this distance function metric (satisfy the triangle inequality)boolean
isSymmetric()
Is this function symmetric?double
similarity(Cluster<?> o1, Cluster<?> o2)
Computes the similarity between two given DatabaseObjects according to this similarity function.
-
-
-
Field Detail
-
STATIC
public static final ClusterJaccardSimilarity STATIC
Static instance.
-
-
Constructor Detail
-
ClusterJaccardSimilarity
public ClusterJaccardSimilarity()
Constructor - use the static instanceSTATIC
!
-
-
Method Detail
-
similarity
public double similarity(Cluster<?> o1, Cluster<?> o2)
Description copied from interface:PrimitiveSimilarity
Computes the similarity between two given DatabaseObjects according to this similarity function.- Specified by:
similarity
in interfacePrimitiveSimilarity<Cluster<?>>
- Parameters:
o1
- first DatabaseObjecto2
- second DatabaseObject- Returns:
- the similarity between two given DatabaseObjects according to this similarity function
-
distance
public double distance(Cluster<?> o1, Cluster<?> o2)
Description copied from interface:PrimitiveDistance
Computes the distance between two given DatabaseObjects according to this distance function.- Specified by:
distance
in interfacePrimitiveDistance<Cluster<?>>
- Parameters:
o1
- first DatabaseObjecto2
- second DatabaseObject- Returns:
- the distance between two given DatabaseObjects according to this distance function
-
isSymmetric
public boolean isSymmetric()
Description copied from interface:Distance
Is this function symmetric?- Specified by:
isSymmetric
in interfaceDistance<Cluster<?>>
- Specified by:
isSymmetric
in interfaceSimilarity<Cluster<?>>
- Returns:
true
when symmetric
-
isMetric
public boolean isMetric()
Description copied from interface:Distance
Is this distance function metric (satisfy the triangle inequality)
-
instantiate
public <T extends Cluster<?>> DistanceSimilarityQuery<T> instantiate(Relation<T> relation)
Description copied from interface:Distance
Instantiate with a database to get the actual distance query.- Specified by:
instantiate
in interfaceDistance<Cluster<?>>
- Specified by:
instantiate
in interfacePrimitiveDistance<Cluster<?>>
- Specified by:
instantiate
in interfacePrimitiveSimilarity<Cluster<?>>
- Specified by:
instantiate
in interfaceSimilarity<Cluster<?>>
- Parameters:
relation
- The representation to use- Returns:
- Actual distance query.
-
getInputTypeRestriction
public SimpleTypeInformation<? super Cluster<?>> getInputTypeRestriction()
Description copied from interface:Distance
Get the input data type of the function.- Specified by:
getInputTypeRestriction
in interfaceDistance<Cluster<?>>
- Specified by:
getInputTypeRestriction
in interfacePrimitiveDistance<Cluster<?>>
- Specified by:
getInputTypeRestriction
in interfaceSimilarity<Cluster<?>>
- Returns:
- Type restriction
-
-