Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 442 Bytes

SorensenDiceCoefficient.md

File metadata and controls

22 lines (14 loc) · 442 Bytes

Sorensen-Dice coefficient

Similar to Jaccard index, but this time the similarity is computed as 2 * |V1 inter V2| / (|V1| + |V2|).

Distance is computed as 1 - similarity.

Example

val sorensenDice = SorensenDice(2)
println(sorensenDice.similarity("ABCDE", "ABCDFG"))

Output:

0.6666666666666666

Links