Skip to content

Commit 9a605c5

Browse files
adds comment explaining hnsw vs flat index choice
1 parent 7e2c1fd commit 9a605c5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

python-recipes/fraud-detection/00_fraud_detection.ipynb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,14 @@
507507
"We index the raw transaction fields (so we can filter and investigate) plus the\n",
508508
"feature `vector`. We use an **HNSW** vector index with **L2 (Euclidean)**\n",
509509
"distance — for standardized feature vectors, L2 directly measures how different\n",
510-
"two transactions' behaviors are."
510+
"two transactions' behaviors are.\n",
511+
"\n",
512+
"We've chosen the **HNSW** approximate nearest neighbors algorithm instead of the\n",
513+
"exact **Flat** nearest neighbors algorithm because in real applications your system\n",
514+
"will likely have many more transactions than this notebook and speed is key for\n",
515+
"catching fraudulent charges as they happen. The **HNSW** algorithm isn't guaranteed\n",
516+
"to find the closest transactions, but it is able to scale to millions of transactions\n",
517+
"while maintaining a fast response rate."
511518
]
512519
},
513520
{

0 commit comments

Comments
 (0)