Distance measures quantify how similar or different data points are, with smaller distances indicating greater similarity. Euclidean distance calculates the straight-line distance using the formula √[(x₂-x₁)² + (y₂-y₁)²]. Manhattan distance sums the absolute differences between coordinates. Minkowski distance generalizes both Euclidean and Manhattan distances with a parameter p. Chebyshev distance takes the maximum absolute difference between coordinates. Cosine similarity measures vector similarity based on the angle between them. Jaccard distance measures dissimilarity between sets using the ratio of intersection to union. These measures are essential for clustering, classification, and recommendation systems in machine learning.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Euclidean Manhattan Minkowski Chebyshev Jaccard Distance & Cosine Similarity by Vidya Mahesh HuddarAdded:
Welcome back. In this video, we are going to understand distance measures in a machine learning with a simple solved examples.
Distance measures are used to find how similar or different data points are.
They play very important role in clustering, classification and recommendation systems.
The smaller the distance, the more similar the data points. Followings are the list of distance measures used in machine learning and data mining. Those are Ukadian distance, Manhattan distance, Minkoski distance, Chubbyu distance, cosine similarity and jakard distance.
We will solve all these methods one by one. So first we will consider the ukidian distance. Ukadian distance is nothing but a shortest straight line distance between the two data points. So Ukadian distance is given by the following formula. If uh a of x1 y1 and b of x2 y2 are at two data points. Then distance between a comma b is equal to square root of x2 - x1 bracket square + y2 - y1 bracket square. To understand this one, we will take a simple example.
Here a of 2a 3 and b of 5a 72 data points are there. So the distance between aa b which is equal to square root of 5 - 2 bracket square + 7 - 3 bracket square. So 5 - 2 is a 3 bracket square + 7 - 3 is a 4 bracket square.
That is square root of 9 + 16 which is equal to 5. This is the distance by using ukidian distance method. So next we'll consider the Manhattan distance.
Manhattan distance is a sum of the absolute difference between the coordinates of the points. So we compute Manhattan distance using following formula that is if a and b are the two data points then a manhattan distance which is equal to absolute difference between x2 and x1 plus absolute difference between y2 and y1. So to understand this one we'll take one example here a of 2a 3 and b of 5a 7 is there. So distance between a comma b is equal to absolute difference between 5 and 2 plus absolute difference between 7 and 3. So 5 - 2 is equal to 3. 7 - 3 is equal to 4. So 3 + 4 which is equal to 7. Next we will consider the minkoski distance. Minkoski distance is a generalized distance measure that includes Ukadian and Manhattan distance as special cases.
The formula for minkoski distance is given as if a of x1 y1 and b of x2 y2 are the two data points then the menoski distance of a comma b is equal to absolute difference between x2 x1 to p plus absolute difference between y2 y1 to p rise to 1 divided by p. To understand this one, we'll take one example. Here a of 2a 3 b of 5a 7 is given with p is equal to 3.
So which is equal to absolute difference between 5 and 2 rest to 3 because here p is 3 plus absolute difference between 7 and 3 rest to 3 rest to 1 / 3. So once we simplify this one we will get a distance between a comma b by using minkos key as 4.497.
So next we will consider the chubbyu distance. Chubby cheu distance is a maximum absolute difference between the corresponding coordinates of two points.
So to calculate this one we will use the following formula that is maximum value between absolute difference between x2 x1 and absolute difference between y2 y1. So here it is a example a of 2a 3 and b of 5a 7. So distance between aa b is equal to maximum value between 5 - 2 and 7 - 3. So 5 - 2 is a 3. 7 - 3 is a 4 and in between 3 and 4 the maximum value is 4. So the distance between a comma b by using chubby chu distance is four.
Next we will consider the cosine similarity. Cosine similarity is a measure that calculates the similarity between two vectors based on the angle between them. This is a formula what we are using to calculate the cosine similarity.
uh that is the cosine similarity of a comma b is equal to multiplication of a and b divided by multiplication of length of a and length of b. So to understand we'll take one simple example here cosine similarity of a and b is equal to a into b that is 2 into 5 + 3 into 7 divided by the length of a. The length of a is nothing but a square root of sum of square of individual coordinates. So that is square root of 2 square + 3 square multiplied with the square root of 5 square + 7 square. Once you simplify this one, we'll get the cosine similarity between a and b is equal to.9997.
Finally, we'll consider the jakard distance. Jakarta distance measures the dissimilarity between two sets based on their intersection and union. So it is calculated as 1 minus the jakard similarity. So which is the ratio of the size of intersection to the size of the union of the sets. If a and b are two sets then the jakard similarity between a and b which is equal to cardinality of intersection of a and b divided by cardinality of union of a and b. So here we have the a set and b set with the values 1 2 3 4 and 3 4 5 6 respectively.
So first we need to find the jakard similarity that is uh a intersection b divided by a union b. First we will calculate the a intersection b. A intersection b is nothing but the common points which are present in the two sets. In these two sets common points are three and a union b is nothing but all the elements present in a and b.
Those are 1 2 3 4 5 and six.
So if you count here the cardinality of A intersection B is nothing but a two that is a length of A intersection B here we have two points so this is two and the length of A union B is 6. So 2 divided by 6 is equal to.33.
So once you find the Jakard similarity next we need to find the Jakard distance which is nothing but 1 minus Jakard similarity. So which is equal to 1 - 333 which is equal to 667.
In this video we have understood a different distance measures solved example step by step. I hope the concept is clear. If you like the video please like, share and subscribe. Press the bell icon for regular updates. Thank you for watching.
Related Videos
Escaping the Fog
LogicLemurGaming
760 views•2026-06-03
Olympiad Mathematics | Indian | Can You Solve This One?
PhilCoolMath
650 views•2026-06-03
A Brutal Radical Expression Made Easy! The Shortcut Changes Everything.
tamoshop
112 views•2026-06-02
V : jee main /advance class 11 mathematics : Binomial Theorem class-1 ( 29 may 2026 )
dcamclassesiitjeemainsadva9953
125 views•2026-05-29
Is This Pentomino Tileable?
3cycle
241 views•2026-05-30
This Sudoku Has Many Lines!!
CrackingTheCryptic
2K views•2026-05-29
Olympiad Mathematics | Indian Can You Solve This One?
PhilCoolMath
268 views•2026-06-02
Olympiad Mathematics | Indian | Can You Solve This?
PhilCoolMath
669 views•2026-06-02











