From the course: Introduction to AI-Native Vector Databases

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Introduce the concept of distance between two vectors

Introduce the concept of distance between two vectors

From the course: Introduction to AI-Native Vector Databases

Introduce the concept of distance between two vectors

Now that we understand that unstructured data can be represented as vectors, let's think about similar and dissimilar data points in vector space. Let's go back to our example of the vector representations of a dog, cat, and wolf. These vectors are very high dimensional, but if we plot them out on our grid, we would likely see the wolf and dog are similar, whereas the cat is different. Let's calculate how far apart these vectors are. There are multiple ways to measure the distance between two vectors. We could use Euclidean distance L2. This is the shortest distance between two vectors, and can be visualized as the length of the line that connects the head of the two vectors you're comparing. You could also use Manhattan distance L1. This is the distance measure from one vector to the other if you could only move along the dimensions of your data. Another popular distance metric we could use is called the cosine distance. This is a measure of how similar the directions of the vectors…

Contents