1. Learn
  2. /
  3. Courses
  4. /
  5. Vector Databases for Embeddings with Pinecone

Connected

Exercise

Changing distance metrics

By default, Pinecone indexes using the cosine similarity distance metric to compute similarity scores between vectors, which are used when querying to find the most similar vectors. Pinecone also supports other distance metrics, including Euclidean distance and the dot product.

The distance metric is set when the index is created, and can't be changed afterwards. In this exercise, you'll practice creating an index that uses the dot product distance metric.

Instructions

100 XP
  • Initialize the Pinecone connection with your API key.
  • Create a new index called "dotproduct-index" that uses the dot product distance metric.
  • List your indexes to verify that it has been created and has the correct metric.