1Z0-184-25 Question 16
Single answerYou have built a product recommendation system on Oracle Cloud Infrastructure using AI vector search. Your image embedding model produces normalized vectors that capture semantic similarities based on direction rather than magnitude. You need to choose the best distance metric to accurately retrieve images that are semantically similar. Which distance metric should you use in this scenario?
- A
Euclidean distance
- B
Jaccard distance
- C
Manhattan distance
- D
Cosine distance
Show answer and explanation
Correct answer: D
Explanation
When vectors are normalized, the direction (i.e., the angle between vectors) is typically more important than the absolute distance. Cosine distance effectively measures how similar the direction of two vectors is, making it well-suited for semantic embeddings in an AI vector search context on Oracle Cloud Infrastructure. For more details, refer to OCI documentation on vector distance metrics and best practices for AI-driven similarity search.
- A. Incorrect.
Option 1 (Euclidean distance): While Euclidean (L2) distance is common, it may not be the ideal metric when vectors are normalized and capture meaning primarily via direction. Euclidean distance focuses more on magnitude differences, which are less relevant for normalized embeddings.
- B. Incorrect.
Option 2 (Jaccard distance): Jaccard distance is generally used for sets or binary-valued vectors (e.g., presence/absence of features). It is not typically suitable for continuous feature embeddings like those generated for product images.
- C. Incorrect.
Option 3 (Manhattan distance): Also known as L1 distance, Manhattan distance sums absolute differences in dimensional values. Although usable in some scenarios, it is still not the best choice for normalized semantic embeddings where angle/direction is the key factor.
- D. Correct.
Option 4 (Cosine distance): Correct. Cosine distance (or 1 - cosine similarity) emphasizes the angle between vectors, making it a strong choice for normalized embeddings that rely on directional similarity rather than magnitude. This accurately captures semantic relatedness of embeddings.