Bird
0
0

Given sets A = {'cat', 'dog', 'mouse'} and B = {'dog', 'elephant', 'mouse', 'cat'}, what is the Jaccard similarity?

medium📝 Predict Output Q5 of 15
NLP - Text Similarity and Search
Given sets A = {'cat', 'dog', 'mouse'} and B = {'dog', 'elephant', 'mouse', 'cat'}, what is the Jaccard similarity?
A0.8
B0.6
C0.75
D0.5
Step-by-Step Solution
Solution:
  1. Step 1: Calculate intersection and union

    Intersection = {'cat', 'dog', 'mouse'} size = 3; Union = {'cat', 'dog', 'mouse', 'elephant'} size = 4.
  2. Step 2: Compute similarity

    Similarity = 3 / 4 = 0.75.
  3. Final Answer:

    0.75 -> Option C
  4. Quick Check:

    Similarity = 3/4 = 0.75 [OK]
Quick Trick: Divide intersection size by union size for similarity [OK]
Common Mistakes:
MISTAKES
  • Miscounting union elements
  • Choosing closest but incorrect decimal
  • Ignoring all elements in union
  • Confusing intersection with union size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NLP Quizzes