|
1 | | -============================================================ |
2 | | - Compare All Algorithms × Metrics |
3 | | - 9 combinations: IVF, HNSW, DiskANN × COS, L2, IP |
4 | | -============================================================ |
| 1 | +============================================== |
| 2 | + Azure DocumentDB - Compare All Algorithms |
| 3 | +============================================== |
| 4 | + Query: "luxury hotel near the beach" |
| 5 | + Top K: 3 |
| 6 | + Metrics: COS, L2, IP |
| 7 | + Algos: IVF, HNSW, DiskANN |
5 | 8 |
|
6 | | -Loaded 50 documents with embeddings |
7 | | -Inserted 50/50 documents |
| 9 | + Loading data from: ../data/Hotels_Vector.json |
| 10 | + Loaded 50 documents |
| 11 | + Inserting 50 documents in batches of 100... |
| 12 | + Inserted batch 1-50 |
| 13 | + Data insertion complete. |
8 | 14 |
|
9 | | -Query: "luxury hotel near the beach" |
10 | | -Top K: 3 |
11 | | -Embedding generated (reused for all searches) |
| 15 | + Generating embedding for: "luxury hotel near the beach" |
| 16 | + Embedding generated (1536 dimensions) |
12 | 17 |
|
13 | | -Running searches (create/search/drop per combo)... |
14 | | - ✔ vector_ivf_cos (created) |
15 | | - ✗ vector_ivf_cos (dropped) |
16 | | - ✔ vector_ivf_l2 (created) |
17 | | - ✗ vector_ivf_l2 (dropped) |
18 | | - ✔ vector_ivf_ip (created) |
19 | | - ✗ vector_ivf_ip (dropped) |
20 | | - ✔ vector_hnsw_cos (created) |
21 | | - ✗ vector_hnsw_cos (dropped) |
22 | | - ✔ vector_hnsw_l2 (created) |
23 | | - ✗ vector_hnsw_l2 (dropped) |
24 | | - ✔ vector_hnsw_ip (created) |
25 | | - ✗ vector_hnsw_ip (dropped) |
26 | | - ✔ vector_diskann_cos (created) |
27 | | - ✗ vector_diskann_cos (dropped) |
28 | | - ✔ vector_diskann_l2 (created) |
29 | | - ✗ vector_diskann_l2 (dropped) |
30 | | - ✔ vector_diskann_ip (created) |
31 | | - ✗ vector_diskann_ip (dropped) |
| 18 | + Running searches (create/search/drop per combo)... |
| 19 | + ✓ vector_ivf_cos (created) |
| 20 | + ✗ vector_ivf_cos (dropped) |
| 21 | + ✓ vector_ivf_l2 (created) |
| 22 | + ✗ vector_ivf_l2 (dropped) |
| 23 | + ✓ vector_ivf_ip (created) |
| 24 | + ✗ vector_ivf_ip (dropped) |
| 25 | + ✓ vector_hnsw_cos (created) |
| 26 | + ✗ vector_hnsw_cos (dropped) |
| 27 | + ✓ vector_hnsw_l2 (created) |
| 28 | + ✗ vector_hnsw_l2 (dropped) |
| 29 | + ✓ vector_hnsw_ip (created) |
| 30 | + ✗ vector_hnsw_ip (dropped) |
| 31 | + ✓ vector_diskann_cos (created) |
| 32 | + ✗ vector_diskann_cos (dropped) |
| 33 | + ✓ vector_diskann_l2 (created) |
| 34 | + ✗ vector_diskann_l2 (dropped) |
| 35 | + ✓ vector_diskann_ip (created) |
| 36 | + ✗ vector_diskann_ip (dropped) |
| 37 | + |
| 38 | + Cleanup: dropping comparison collection... |
| 39 | + Cleanup: dropped collection 'hotels' |
32 | 40 |
|
33 | 41 | ╔════════════════════════════════════════════════════════════════════════════════════════════════════════╗ |
34 | | - ║ COMPARISON TABLE — All Algorithms × Metrics ║ |
| 42 | + ║ COMPARISON TABLE — All Algorithms × Metrics ║ |
35 | 43 | ╠════════════════════════════════════════════════════════════════════════════════════════════════════════╣ |
36 | | - ║ ALGO SIMILAR. #1 RESULT #1 SCORE #2 RESULT #2 SCORE DIFF ║ |
| 44 | + ║ ALGO SIMILAR. #1 RESULT #1 SCORE #2 RESULT #2 SCORE DIFF ║ |
37 | 45 | ╠════════════════════════════════════════════════════════════════════════════════════════════════════════╣ |
38 | | - ║ IVF COS Ocean Water Resort &.. 0.6184 Windy Ocean Motel 0.5056 0.1128 ║ |
39 | | - ║ IVF L2 Ocean Water Resort &.. 0.8736 Windy Ocean Motel 0.9943 -0.1208 ║ |
40 | | - ║ IVF IP Ocean Water Resort &.. 0.6184 Windy Ocean Motel 0.5056 0.1128 ║ |
41 | | - ║ HNSW COS Ocean Water Resort &.. 0.6184 Windy Ocean Motel 0.5056 0.1128 ║ |
42 | | - ║ HNSW L2 Ocean Water Resort &.. 0.8736 Windy Ocean Motel 0.9943 -0.1208 ║ |
43 | | - ║ HNSW IP Ocean Water Resort &.. 0.6184 Windy Ocean Motel 0.5056 0.1128 ║ |
44 | | - ║ DiskANN COS Ocean Water Resort &.. 0.6184 Windy Ocean Motel 0.5056 0.1128 ║ |
45 | | - ║ DiskANN L2 Ocean Water Resort &.. 0.8736 Windy Ocean Motel 0.9943 -0.1208 ║ |
46 | | - ║ DiskANN IP Ocean Water Resort &.. 0.6184 Windy Ocean Motel 0.5056 0.1128 ║ |
| 46 | + ║ IVF COS Ocean Water Resort &.. 0.6184 Windy Ocean Motel 0.5057 0.1128 ║ |
| 47 | + ║ IVF L2 Ocean Water Resort &.. 0.8735 Windy Ocean Motel 0.9942 -0.1207 ║ |
| 48 | + ║ IVF IP Ocean Water Resort &.. 0.6183 Windy Ocean Motel 0.5056 0.1127 ║ |
| 49 | + ║ HNSW COS Ocean Water Resort &.. 0.6184 Windy Ocean Motel 0.5057 0.1128 ║ |
| 50 | + ║ HNSW L2 Ocean Water Resort &.. 0.8735 Windy Ocean Motel 0.9942 -0.1207 ║ |
| 51 | + ║ HNSW IP Ocean Water Resort &.. 0.6183 Windy Ocean Motel 0.5056 0.1127 ║ |
| 52 | + ║ DISKANN COS Ocean Water Resort &.. 0.6184 Windy Ocean Motel 0.5057 0.1128 ║ |
| 53 | + ║ DISKANN L2 Ocean Water Resort &.. 0.8735 Windy Ocean Motel 0.9942 -0.1207 ║ |
| 54 | + ║ DISKANN IP Ocean Water Resort &.. 0.6183 Windy Ocean Motel 0.5056 0.1127 ║ |
47 | 55 | ╠════════════════════════════════════════════════════════════════════════════════════════════════════════╣ |
48 | | - ║ 🎯 Highest score: IVF/COS (0.6184) ║ |
49 | | - ║ 📊 Biggest separation: 0.1128 ║ |
| 56 | + ║ ★ Highest score: IVF/COS (0.6184) ║ |
| 57 | + ║ ★ Biggest separation: 0.1128 ║ |
50 | 58 | ╠════════════════════════════════════════════════════════════════════════════════════════════════════════╣ |
51 | 59 | ║ KEY INSIGHTS ║ |
52 | | - ║ 🔑 All algorithms return the same top results — algorithm choice ║ |
| 60 | + ║ • All algorithms return the same top results — algorithm choice ║ |
53 | 61 | ║ affects performance at scale, not accuracy on small datasets. ║ |
54 | | - ║ 📐 COS and IP produce identical scores (normalized embeddings). ║ |
55 | | - ║ 📏 L2 scores are distances (lower = closer), not similarities. ║ |
| 62 | + ║ • COS and IP produce identical scores (normalized embeddings). ║ |
| 63 | + ║ • L2 scores are distances (lower = closer), not similarities. ║ |
56 | 64 | ╚════════════════════════════════════════════════════════════════════════════════════════════════════════╝ |
57 | 65 |
|
58 | | -Cleanup: dropped collection 'hotels' |
| 66 | +============================================== |
| 67 | + Comparison complete. |
| 68 | +============================================== |
0 commit comments