|
Calling Sequence
|
|
DiceCoefficient( v1, v2 )
BinaryDiceCoefficient( v1, v2 )
|
|
Parameters
|
|
v1, v2
|
-
|
vector or list of integers
|
|
|
|
|
Description
|
|
•
|
The dice coefficient is a measure of similarity between two vectors.
|
•
|
In binary form, where the vectors contain 1's and 0's, the formula can be expressed in set notation.
|
•
|
Both v1 and v2 must be the same size.
|
•
|
In the context of text comparison, v1 and v2 could be a count of the occurrences of certain words within two essay sets. In the binary form v1 and v2 would contain 1 for the presence of a word, and 0 for its absence.
|
•
|
For positive integer counts, the Dice and BinaryDice coefficients will range from 0 to 1, where 1 is a perfect match, and 0 indicates no overlap. The higher the score in-between, the more similar the vectors.
|
•
|
The Binary form of this command will accept any vector as input and interpret all non-zero entries as 1s.
|
•
|
These functions are part of the EssayTools package, so they can be used in the short form, for example, DiceCoefficient(..), only after executing the command with(EssayTools). However, they can always be accessed through the long form of the command names by using, for example, EssayTools[DiceCoefficient](..).
|
|
|
Examples
|
|
| (1) |
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
| (8) |
>
|
|
>
|
|
>
|
|
>
|
|
| (12) |
>
|
|
>
|
|
>
|
|
>
|
|
|
|
Compatibility
|
|
•
|
The EssayTools[DiceCoefficient] and EssayTools[BinaryDiceCoefficient] commands were introduced in Maple 17.
|
|
|
|