Set Module

Functions and values

Function or value Description

jaccard x y

Full Usage: jaccard x y

Parameters:
Returns: float
Modifiers: inline
Type parameters: 'T

Computes the Jaccard index of two finite sets, also known as Intersection over Union.

The Jaccard coefficient measures similarity between finite sample sets, and is defined as the size of the intersection divided by the size of the union of the sample sets

x : Set<'T>

y : Set<'T>

Returns: float

Example

overlap x y

Full Usage: overlap x y

Parameters:
Returns: float
Modifiers: inline
Type parameters: 'T

Computes the overlap coefficient, or Szymkiewicz�Simpson coefficient

The Overlap coefficient measures the overlap between two finite sets. It is related to the Jaccard index and is defined as the size of the intersection divided by the smaller of the size of the two sets.

If set X is a subset of Y or the converse then the overlap coefficient is equal to 1.

x : Set<'T>

y : Set<'T>

Returns: float

Example

sorensenDice x y

Full Usage: sorensenDice x y

Parameters:
Returns: float
Modifiers: inline
Type parameters: 'T

Computes the Sorensen�Dice coefficient similarity measure for two finite sets

ATTENTION: The Sorensen�Dice coefficient doesn't satisfy the triangle inequality. The corresponding difference function (1 - sorensenDice) is not a proper distance measure.

x : Set<'T>

y : Set<'T>

Returns: float

Example

tversky prototypeWeight variantWeight prototype variant

Full Usage: tversky prototypeWeight variantWeight prototype variant

Parameters:
    prototypeWeight : float -
    variantWeight : float -
    prototype : Set<'T> -
    variant : Set<'T> -

Returns: float
Modifiers: inline
Type parameters: 'T

Computes the Tversky index, an asymmetric similarity measure on sets that compares a variant to a prototype.
The Tversky index can be seen as a generalization of Sorencsen-Dice coefficient and Jaccard index.

ATTENTION: this is an asymmetric similarity measure. Use tverskySymmetric if symmetry is needed.

prototypeWeight : float

variantWeight : float

prototype : Set<'T>

variant : Set<'T>

Returns: float

Example

tverskySymmetric prototypeWeight variantWeight prototype variant

Full Usage: tverskySymmetric prototypeWeight variantWeight prototype variant

Parameters:
    prototypeWeight : float -
    variantWeight : float -
    prototype : Set<'T> -
    variant : Set<'T> -

Returns: float
Modifiers: inline
Type parameters: 'T

Computes the symmetric variant of the Tversky index. https://www.aclweb.org/anthology/S13-1028

prototypeWeight : float

variantWeight : float

prototype : Set<'T>

variant : Set<'T>

Returns: float

Example