ContentsThe library

Vectors, Distance and Similarity

Which Question Are You Actually Asking

Last timeFinding the Nearest Ones

Distance, dot product and angle disagree about which pairs are close. The choice follows from one question about your data and one about how the vectors were produced.

Three measures, all reasonable, all disagreeing about which pairs are close. This

lesson is the decision procedure, and it is shorter than the arguments people

usually have about it.

The first question

Does length mean anything in your collection?

FIG 1The decision, in full
Notice that the left branch ends the argument entirely: once the vectors are normalised, the choice between distance and angle has no content, because they produce the same ranking.

Length usually means something mechanical rather than meaningful. A longer

document, more occurrences counted, more tokens in the passage. Those are

nuisances and the cosine removes them. But it is not universal: in some models

the length of a vector tracks how strongly the model detected something, and

dividing that out means a tentative match and an emphatic one score the same.

The lesson stops here

6 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01The Same List, Read Two Ways
  2. 02Straight Lines and City Blocksopening only
  3. 03Multiply, Add, and Get an Angleopening only
  4. 04Dividing the Lengths Outopening only
  5. 05When Distance and Angle Become the Same Questionopening only
  6. 06Everything Is Far Away and Nothing Is Nearbyopening only
  7. 07The Cost of Asking What Is Nearbyopening only
  8. 08Which Question Are You Actually Askingyou are here

Read alongside