Hello, in this video you're going to learn about Euclidean distance, which is a similarity metric. This metric allows you to identify how far two points or two vectors are apart from each other. During this segment, you will get the Euclidean distance between two documents vectors like the ones from the previous video. And then generalize that notion to vector spaces in higher dimensions. Let's use two of the corpora vectors you saw previously. Remember, in that's example, there were two dimensions. The number of times that the word data and the word film appeared in the Corpus. Corpus A will be the entertainment Corpus and Corpus B will be the machine learning Corpus. Now let's represent those vectors as points in the vector space. The Euclidean distance is the length of the straight line segment connecting them. To get that value, you should use the following formula. The first term is their horizontal distance squared and the second term is their vertical distance squared. As you see, this formula is an example of the Pythagorean theorem. If you solve for each of the terms in the equation, you should arrive at this expression. And at last, get a Euclidean distance approximately equal to 10,667, feel free to pause the video and check this process. When you have higher dimensions, the Euclidean distance is not much more difficult. Let's walk through an example using the following co-occurrence matrix. Suppose that you want to know the Euclidean distance between the vector v of the word ice cream and the vector representation w of the word boba. To start, you need to get the difference between each of their dimensions, square those differences, sum them up and then get the square root of your results. This process is the generalization of the one from the last slide. This is the formula that you would use to get the Euclidean distance between vector representations on an n-dimensional vector space. If you remember from algebra, this formula is known as the norm of the difference between the vectors that you are comparing. Let's take a look at the implementation of the Euclidean distance in Python. If you have to vector a presentations, like the ones from the previous example, you can use the linalg module from numpy to get the norm of the difference between them. If you implement this code in Python, you should get this results, the norm function works for n-dimensional spaces. The primary takeaways here are that the Euclidean distance is basically the length of the straight line that's connects two vectors. And that to get the Euclidean distance, you have to calculate the norm of the difference between the vectors that you are comparing. By using this metric, you can get a sense of how similar two documents or words are. Now that you have learned Euclidean distance, in the next video, I will show you a different type of similarity function. Concretely, I'll show you the cosine similarity function, which is one of the most popular similarity functions. See you in the next video.