Challenge

Unsupervised Learning - Kmeans Week 11 Challenge

1. How does similarity is calculated if data is categorical in nature:-

Jaccard Similarity:

Jaccard similarity measures the similarity between two sets by comparing their intersection and union. For two categorical vectors, it is calculated as the size of the intersection divided by the size of the union.

J(A,B)=∣A∪B∣∣A∩B∣​

Hamming Distance:

Hamming distance measures the number of positions at which corresponding elements between two categorical vectors are different. It is normalized to a similarity measure by subtracting the Hamming distance from the length of the vectors.

Hamming Similarity 1−Hamming Distance Length of VectorsHamming Similarity(A,B)=1−Length of VectorsHamming Distance(A,B)​

Dice Similarity Coefficient:

Dice similarity is similar to Jaccard similarity but uses a different formula. It is often used for comparing the similarity between two binary vectors.

D(A,B)=∣A∣+∣B∣2∣A∩B∣​

Overlap Coefficient:

The overlap coefficient measures the overlap between two sets, similar to Jaccard similarity. It is the size of the intersection divided by the size of the smaller set.

Overlap(A,B)=min(∣A∣,∣B∣)∣A∩B∣​

Cosine Similarity for Binary Vectors:

Cosine similarity is commonly used for binary vectors. It measures the cosine of the angle between the two vectors.

Cosine Similarity(A,B)=∥A∥⋅∥B∥A⋅B​

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.