Enum SetSimilarity
java.lang.Object
java.lang.Enum<SetSimilarity>
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.util.SetSimilarity
- All Implemented Interfaces:
Serializable
,Comparable<SetSimilarity>
,Constable
public enum SetSimilarity extends Enum<SetSimilarity>
Different methods for set comparison like Overlap coefficient, Jaccard or Sørensen–Dice_coefficient (DSC).
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description ABSOLUTE
Returns absolute number of the intersection.BOOLEAN
Returns 1 if intersection is not empty and 0 if it is empty.DICE
Sørensen-Dice coefficient (DSC): twice the number of intersection set divided by the sum of the number of elements in each set.JACCARD
Jaccard index: intersection divided by the size of the union.MAX
The intersection divided by the larger of the size of the two sets.MIN
The intersection divided by the smaller of the size of the two sets. -
Constructor Summary
Constructors Modifier Constructor Description private
SetSimilarity()
-
Method Summary
Modifier and Type Method Description double
compute(int sizeIntersection, int sizeX, int sizeY)
Compute the set comparison.<E> double
compute(Set<E> x, Set<E> y)
Compute the set comparison.static SetSimilarity
valueOf(String name)
Returns the enum constant of this type with the specified name.static SetSimilarity[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
BOOLEAN
Returns 1 if intersection is not empty and 0 if it is empty. -
ABSOLUTE
Returns absolute number of the intersection. Not a real comparison. -
MIN
The intersection divided by the smaller of the size of the two sets. Also known as Overlap coefficient. -
MAX
The intersection divided by the larger of the size of the two sets. -
JACCARD
Jaccard index: intersection divided by the size of the union. -
DICE
Sørensen-Dice coefficient (DSC): twice the number of intersection set divided by the sum of the number of elements in each set.
-
-
Constructor Details
-
SetSimilarity
private SetSimilarity()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
compute
Compute the set comparison.- Type Parameters:
E
- Generic type of the sets- Parameters:
x
- set xy
- set y- Returns:
- set comparison value
-
compute
public double compute(int sizeIntersection, int sizeX, int sizeY)Compute the set comparison.- Parameters:
sizeIntersection
- the number of intersection of the two setssizeX
- size of set xsizeY
- size of set y- Returns:
- set comparison value
-