← TF-IDF All techniques Next: Hierarchical →

32 — Distance & Similarity Measures

"How far apart are two points?" The answer depends on which metric you use. Pick one and drag the points — the colored region shows all points within distance r of point A.

distance = √((x₁−x₂)² + (y₁−y₂)²)
Point A(20, 30)
Point B(70, 65)
Distance / Similarity
Click and drag points A and B in the canvas.
When each shines: Euclidean = straight-line, the default for continuous data. Manhattan = grid walk, robust to outliers. Chebyshev = max coordinate diff, used in chess king moves. Cosine = angle between vectors, ignores magnitude (best for documents). Jaccard = set overlap, for binary/presence data.