Nearest neighbor search retrieves an element of a stored set minimizing its distance from a query. For a finite set in a metric space with distance , the exact task is to return satisfyingFor example, among , and , the nearest point to in Euclidean distance is , at distance . Scanning all points in dimensions takes arithmetic work; a useful index eliminates candidates while preserving the required guarantee.
In a recommender system, stored items and queries can be vectors learned by machine learning. The comparison rule matters: minimizing Euclidean distance and maximizing dot product need not rank items identically. For unit vectors, , so those two rankings coincide.[ref]
Articles by others on the same topic
Nearest neighbor search is a fundamental problem in computer science and data analysis that involves finding the closest point(s) in a multi-dimensional space to a given query point. It is commonly used in various applications, including machine learning, computer vision, recommendation systems, and robotics. ### Key Concepts: 1. **Distance Metric**: The notion of "closeness" is defined by a distance metric.