jaccard_m: jaccard_m

Description Usage Arguments Details Value Examples

View source: R/jaccard_m.R

Description

multiset jaccard for two sets A and B

Usage

1
jaccard_m(vec1, vec2)

Arguments

vec1

A vector

vec2

A vector

Details

Let n(a,A) be the number of occurences of element a in multiset A. definition: numerator/denominator where numerator = sum( min( n(a,A) , n(a,B) ) for every a in union(A,B)) and denominator = sum( max( n(a,A) , n(a,B) ) for every a in union(A,B))

Value

A number

Examples

1
2
3
set.seed(1); A = sample(letters, 100, TRUE)
set.seed(2); B = sample(letters, 100, TRUE)
jaccard_m(A, B)

talegari/sidekicks documentation built on Sept. 26, 2018, 4:18 p.m.