logo

Jaccard Coefficient Calculations

Unit 5

This simple exercise shows the calculation of the Jaccard coefficient in a sample dataset.

Pathological Test Results

The table shows the pathological test results for three individuals.

NameGenderFeverCoughTest-1Test-2Test-3Test-4
JackMYNPNNA
MaryFYNPAPN
JimMYPNNNA

Jaccard Coefficient Calculations

Given:

Jaccard(A,B)=Number of Common Positive IndicatorsTotal Number of IndicatorsJaccard(A, B) = \frac{ \text{Number of Common Positive Indicators}}{\text{Total Number of Indicators}}

Pair (Jack, Mary)

Difference of observations in both:

(JackMary)={Test-3}=1(Jack \cap Mary) = \{ \text{Test-3} \} = 1

Total Attributes:

(JackMary)={Fever, Cough, Test-3}=3(Jack \cup Mary) = \{ \text{Fever, Cough, Test-3} \} = 3

Jaccard Coefficient:

J(Jack,Mary)=13=0.33 J(Jack, Mary) = \frac{1}{3} = 0.33

Pair (Jack, Jim)

Difference of observations in both:

(JackJim)={Cough, Test-1}=2(Jack \cap Jim) = \{ \text{Cough, Test-1} \} = 2

Total Attributes:

(JackJim)={Fever, Cough, Test-1}=3(Jack \cup Jim) = \{ \text{Fever, Cough, Test-1} \} = 3

Jaccard Coefficient:

J(Jack,Jim)=23=0.67 J(Jack, Jim) = \frac{2}{3} = 0.67

Pair (Jim, Mary)

Difference of observations in both:

(JimMary)={Cough, Test-1}=2(Jim \cap Mary) = \{ \text{Cough, Test-1} \} = 2

Total Attributes:

(JimMary)={Fever, Cough, Test-1, Test-2, Test-3, Test-4}=6(Jim \cup Mary) = \{ \text{Fever, Cough, Test-1, Test-2, Test-3, Test-4} \} = 6

Jaccard Coefficient:

J(Jim,Mary)=16=0.17 J(Jim, Mary) = \frac{1}{6} = 0.17