Package elki.similarity.cluster
Class ClusterIntersectionSimilarity
- java.lang.Object
-
- elki.similarity.cluster.ClusterIntersectionSimilarity
-
- All Implemented Interfaces:
Distance<Cluster<?>>
,PrimitiveDistance<Cluster<?>>
,PrimitiveSimilarity<Cluster<?>>
,Similarity<Cluster<?>>
public class ClusterIntersectionSimilarity extends java.lang.Object implements PrimitiveDistance<Cluster<?>>, PrimitiveSimilarity<Cluster<?>>
Measure the similarity of clusters via the intersection size.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClusterIntersectionSimilarity.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description static ClusterIntersectionSimilarity
STATIC
Static instance.
-
Constructor Summary
Constructors Constructor Description ClusterIntersectionSimilarity()
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 ClusterIntersectionSimilarity STATIC
Static instance.
-
-
Constructor Detail
-
ClusterIntersectionSimilarity
public ClusterIntersectionSimilarity()
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
-
-