Package elki.similarity.cluster
Class ClusteringFowlkesMallowsSimilarity
- java.lang.Object
-
- elki.similarity.cluster.ClusteringFowlkesMallowsSimilarity
-
- All Implemented Interfaces:
Distance<Clustering<?>>
,PrimitiveDistance<Clustering<?>>
,ClusteringDistanceSimilarity
,NormalizedSimilarity<Clustering<?>>
,PrimitiveSimilarity<Clustering<?>>
,Similarity<Clustering<?>>
@Reference(authors="E. B. Fowlkes, C. L. Mallows", title="A method for comparing two hierarchical clusterings", booktitle="Journal of the American Statistical Association, Vol. 78 Issue 383", url="https://doi.org/10.2307/2288117", bibkey="doi:10.2307/2288117") public class ClusteringFowlkesMallowsSimilarity extends java.lang.Object implements ClusteringDistanceSimilarity, NormalizedSimilarity<Clustering<?>>
Measure the similarity of clusters via the Fowlkes-Mallows Index.Reference:
E. B. Fowlkes, C. L. Mallows
A method for comparing two hierarchical clusterings
In: Journal of the American Statistical Association, Vol. 78 Issue 383- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClusteringFowlkesMallowsSimilarity.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description static ClusteringFowlkesMallowsSimilarity
STATIC
Static instance.
-
Constructor Summary
Constructors Constructor Description ClusteringFowlkesMallowsSimilarity()
Constructor - use the static instanceSTATIC
!
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(Clustering<?> o1, Clustering<?> o2)
Computes the distance between two given DatabaseObjects according to this distance function.SimpleTypeInformation<? super Clustering<?>>
getInputTypeRestriction()
Get the input data type of the function.<T extends Clustering<?>>
DistanceSimilarityQuery<T>instantiate(Relation<T> relation)
Instantiate with a representation to get the actual similarity query.boolean
isMetric()
Is this distance function metric (satisfy the triangle inequality)double
similarity(Clustering<?> o1, Clustering<?> o2)
Computes the similarity between two given DatabaseObjects according to this similarity function.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.similarity.cluster.ClusteringDistanceSimilarity
isSymmetric
-
-
-
-
Field Detail
-
STATIC
public static final ClusteringFowlkesMallowsSimilarity STATIC
Static instance.
-
-
Constructor Detail
-
ClusteringFowlkesMallowsSimilarity
public ClusteringFowlkesMallowsSimilarity()
Constructor - use the static instanceSTATIC
!
-
-
Method Detail
-
similarity
public double similarity(Clustering<?> o1, Clustering<?> o2)
Description copied from interface:PrimitiveSimilarity
Computes the similarity between two given DatabaseObjects according to this similarity function.- Specified by:
similarity
in interfacePrimitiveSimilarity<Clustering<?>>
- Parameters:
o1
- first DatabaseObjecto2
- second DatabaseObject- Returns:
- the similarity between two given DatabaseObjects according to this similarity function
-
distance
public double distance(Clustering<?> o1, Clustering<?> o2)
Description copied from interface:PrimitiveDistance
Computes the distance between two given DatabaseObjects according to this distance function.- Specified by:
distance
in interfacePrimitiveDistance<Clustering<?>>
- Parameters:
o1
- first DatabaseObjecto2
- second DatabaseObject- Returns:
- the distance between two given DatabaseObjects according to this distance function
-
isMetric
public boolean isMetric()
Description copied from interface:Distance
Is this distance function metric (satisfy the triangle inequality)- Specified by:
isMetric
in interfaceDistance<Clustering<?>>
- Returns:
true
when metric.
-
instantiate
public <T extends Clustering<?>> DistanceSimilarityQuery<T> instantiate(Relation<T> relation)
Description copied from interface:Similarity
Instantiate with a representation to get the actual similarity query.- Specified by:
instantiate
in interfaceClusteringDistanceSimilarity
- Specified by:
instantiate
in interfaceDistance<Clustering<?>>
- Specified by:
instantiate
in interfacePrimitiveDistance<Clustering<?>>
- Specified by:
instantiate
in interfacePrimitiveSimilarity<Clustering<?>>
- Specified by:
instantiate
in interfaceSimilarity<Clustering<?>>
- Parameters:
relation
- Representation to use- Returns:
- Actual distance query.
-
getInputTypeRestriction
public SimpleTypeInformation<? super Clustering<?>> getInputTypeRestriction()
Description copied from interface:Similarity
Get the input data type of the function.- Specified by:
getInputTypeRestriction
in interfaceDistance<Clustering<?>>
- Specified by:
getInputTypeRestriction
in interfacePrimitiveDistance<Clustering<?>>
- Specified by:
getInputTypeRestriction
in interfaceSimilarity<Clustering<?>>
- Returns:
- Type restriction
-
-