Skip to contents

Human similarity judgements are not symmetric, and a symmetric coefficient cannot express that. The two weights let the two kinds of mismatch cost different amounts. Both weights 1 recovers Jaccard-Tanimoto, both 0.5 recovers Dice.

Usage

Tvsbn(fp_a, fp_b, alpha = 0.5, beta = 0.5)

Arguments

fp_a

Binary fingerprint A; non-zero counts as present.

fp_b

Binary fingerprint B, same length.

alpha

Weight on features unique to A.

beta

Weight on features unique to B.

Value

List with estimate, common, only_a, only_b, n_bits.

Details

Formula: S = |A n B| / (|A n B| + alpha |A \ B| + beta |B \ A|).

References

Tversky, A. (1977). Features of similarity. Psychological Review 84:327-352, equation (5).

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Tvsbn(V, V)
#> $estimate
#> [1] 1
#> 
#> $common
#> [1] 8
#> 
#> $only_a
#> [1] 0
#> 
#> $only_b
#> [1] 0
#> 
#> $n_bits
#> [1] 8
#> 
#> $method
#> [1] "Tversky similarity index"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"