Lesson 1.3

Similarity metrics and thresholds

Cosine similarity is the usual default, but the number it gives you is only meaningful relative to your own corpus. Calibrate the threshold, do not guess it.

Duration
8m
Level
Advanced
Students
8.2k students

Overview

Cosine similarity is the usual default, but the number it gives you is only meaningful relative to your own corpus. Calibrate the threshold, do not guess it.

In this lesson you will:

  • Compare cosine, dot product, and euclidean distance
  • Calibrate a relevance threshold on real queries
  • Detect the case where nothing is actually relevant

Resources

Sanity Context and content APIs

The official reference for the tools used in this lesson.