How to find Euclidean Manhattan Minkowski distance Supremum distance Cosine Similarity Mahesh Huddar
Summary
TLDRThis video explains how to calculate various distance measures—Euclidean, Manhattan, Minkowski, Supremum distance—and the cosine similarity between data points. Using five given data points and a new data point, the narrator demonstrates step-by-step how to apply each formula to find the distance between points. The video breaks down each distance measure with clear examples, ensuring a thorough understanding of the concepts. It also covers how cosine similarity is used for measuring the angle between vectors, commonly used in machine learning and data analysis. Viewers are guided to understand both the theory and practical application of these measures.
Takeaways
- 😀 Euclidean distance is calculated using the formula: sqrt((x2 - x1)^2 + (y2 - y1)^2).
- 😀 Manhattan distance uses the formula: |x2 - x1| + |y2 - y1|, focusing on the absolute differences.
- 😀 Minkowski distance is a generalization of both Euclidean and Manhattan distance, with a parameter 'H' that can adjust the formula.
- 😀 When 'H' equals 2, Minkowski distance becomes the same as Euclidean distance.
- 😀 Supremum distance is calculated using the formula: max(|x2 - x1|, |y2 - y1|), focusing on the largest difference.
- 😀 Cosine similarity compares the cosine of the angle between two vectors and is calculated using: (sum(a_i * b_i)) / (sqrt(sum(a_i^2)) * sqrt(sum(b_i^2))).
- 😀 The script explains the process of calculating distance metrics between a new data point and five existing data points.
- 😀 The formula for Manhattan distance sums the absolute differences between the corresponding coordinates of the two points.
- 😀 The Minkowski distance formula generalizes distance metrics by raising the differences to the power of 'H'.
- 😀 The video includes practical examples to demonstrate how to compute each distance metric using a new data point and existing data points.
Q & A
What is the Euclidean distance formula?
-The Euclidean distance formula is: √((x2 - x1)² + (y2 - y1)²), where (x1, y1) and (x2, y2) are the coordinates of two points.
How do you calculate the Euclidean distance between two points?
-To calculate the Euclidean distance between two points, subtract the coordinates of the first point from the second point, square the differences, sum them, and then take the square root of the sum.
What is Manhattan distance, and how is it different from Euclidean distance?
-Manhattan distance is calculated as the sum of the absolute differences of their x and y coordinates: |x2 - x1| + |y2 - y1|. It differs from Euclidean distance, which involves squaring the differences and taking the square root.
What does the Minkowski distance formula look like, and what is its relationship to Euclidean distance?
-The Minkowski distance formula is: ((|x2 - x1|^h + |y2 - y1|^h)^(1/h)), where h is a parameter. When h=2, Minkowski distance is equivalent to Euclidean distance.
How does the supremum distance (Chebyshev distance) work?
-The supremum distance is calculated as the maximum of the absolute differences between the corresponding coordinates: max(|x2 - x1|, |y2 - y1|). It finds the largest difference between the two points in any dimension.
What is the formula for calculating cosine similarity?
-The formula for cosine similarity is: (Σ a_i * b_i) / (√Σ a_i² * √Σ b_i²), where a and b are two vectors. It calculates the cosine of the angle between the two vectors, which helps in determining their similarity.
What is the relationship between cosine similarity and the angle between vectors?
-Cosine similarity measures the cosine of the angle between two vectors. If the cosine similarity is 1, the vectors are identical (angle is 0 degrees). If it is 0, the vectors are orthogonal (90 degrees), and if it is -1, the vectors are opposite.
What is the significance of the parameter 'h' in Minkowski distance?
-The parameter 'h' in Minkowski distance determines the type of distance calculation. If h=1, the distance is Manhattan distance, and if h=2, it is Euclidean distance. For values other than 1 or 2, the formula calculates a general Minkowski distance.
Can you provide an example of calculating Manhattan distance?
-For two points (x1, y1) = (1.5, 1.7) and (x2, y2) = (1.4, 1.6), the Manhattan distance is calculated as: |1.4 - 1.5| + |1.6 - 1.7| = 0.1 + 0.1 = 0.2.
How is cosine similarity used in measuring similarity between two data points?
-Cosine similarity is used to assess how similar two data points are based on their vector representations. A higher cosine similarity indicates that the points are more similar, while a lower value indicates they are less similar.
Outlines

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowMindmap

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowKeywords

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowHighlights

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowTranscripts

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowBrowse More Related Video

Euclidean Distance & Cosine Similarity | Introduction to Data Mining part 18

Hierarchical Cluster Analysis [Simply explained]

Algoritma K-Means Klustering Data Mining | Seri Data Mining #5

Cara Menghitung Jarak Antara Dua Titik Koordinat || Teorema Pythagoras Matematika Kelas 8

K Means Clustering Algorithm | K Means Solved Numerical Example Euclidean Distance by Mahesh Huddar

Konsep Algoritma KNN (K-Nearest Neigbors) dan Tips Menentukan Nilai K
5.0 / 5 (0 votes)