Jaccard similarity calculate similarity

It is not clear to me how to calculate similarity between two products from the example.

How do they calculate that?

Topic jaccard-coefficient similarity

Category Data Science


Note the instruction is to view the utility matrix as boolean. That is if it is positive, then view it as $1$ and $0$ otherwise.

Example, to compute the Jaccard similairty between $a$ and $b$.

Consider the component of $a$ to be $(1,0,1,1,0,1)$ and component of $b$ to be $(0,1,1,0,1,1)$.

To compute $|a \cap b|$, look at how many position where both of the values are $1$. This is satisfied at the third and the sixth coordinate. Hence the value is $2$.

To compute $|a \cup b|$, look at how many position where at least one of the value is $1$. This is satisfied at every position. Hence the value is $6$.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.