Jaccard: Jaccard

Description Usage Arguments Details Value

View source: R/jaccard.R

Description

Stolen from the clusteval package as there is currently a bug with the package on CRAN where this function is not exported from the namespae of clusteval. Computes the Jaccard similarity coefficient of two clusterings of the same data set under the assumption that the two clusterings are independent.

For two clusterings of the same data set, this function calculates the Jaccard similarity coefficient of the clusterings from the comemberships of the observations. Basically, the comembership is defined as the pairs of observations that are clustered together.

Usage

1
Jaccard(labels1, labels2)

Arguments

labels1

a vector of n clustering labels

labels2

a vector of n clustering labels

Details

The Jaccard similarity coefficient is defined as:

J = \frac{n_{11}}{n_{11} + n_{10} + n_{01}}

.

In the special case that the Jaccard coefficient results in 0/0, we define J = 0. For instance, this case can occur when both clusterings consist of all singleton clusters.

To compute the contingency table, we use the comembership_table function.

Value

the Jaccard coefficient for the two sets of cluster labels (See Details.)


nathansam/CircadianTools documentation built on Dec. 26, 2019, 11:30 a.m.