jaccard {iTOP}R Documentation

Jaccard similarity.

Description

Computes the Jaccard similarity between x and y. When both x and y only contain zeroes, the Jaccard similarity it not defined. This function returns zero for that specific case.

Usage

jaccard(x, y)

Arguments

x

A vector of zeroes and ones.

y

A vector of zeroes and ones.

Value

The Jaccard similarity between x and y.

Examples

set.seed(2)
n = 100
x = rbinom(n, 1, 0.5)
y = rbinom(n, 1, 0.5)
jaccard(x, y)

[Package iTOP version 1.0.2 Index]