ā Simulators
š Cosine vs Distance & 3D Embeddings
Compare similarity metrics and explore embedding space in 3D.
Cosine similarity vs Euclidean distance
Cosine similarity (angle)
83.2%
Same direction ā 1; orthogonal ā 0
Euclidean distance
0.45
Length of line between A and B
Normalized vectors: cosine = dot product. DBs often use cosine for similarity.
3D embedding space (rotating)
Loading 3Dā¦
Same words (cat, kitten, dog, pizza, ā¦) as 3D points. Similar meaning = close in space.
Similarity search: metric, top-k, data type & weights
Metric
Top-k
5Data type filter
Document labels & weights (top-5 results)
| Rank | Label | Type | Weight | Similarity |
|---|---|---|---|---|
| 1 | Doc A | text | 1 | 92% |
| 2 | Doc B | text | 1 | 88% |
| 3 | Doc D | text | 1 | 82% |
| 4 | Doc E | mixed | 0.9 | 70% |
| 5 | Doc C | code | 0.8 | 68% |
Weights can boost or downweight docs (e.g. by source or freshness). Data type helps filter before/after search.