9 releases

0.8.1 Dec 23, 2025
0.8.0 Sep 30, 2025
0.7.2 Jul 9, 2025
0.7.1 Jan 14, 2025
0.5.0 Oct 21, 2021

#867 in Machine learning

Download history 3250/week @ 2025-09-25 3717/week @ 2025-10-02 3961/week @ 2025-10-09 3389/week @ 2025-10-16 3370/week @ 2025-10-23 3574/week @ 2025-10-30 3529/week @ 2025-11-06 3684/week @ 2025-11-13 4038/week @ 2025-11-20 3196/week @ 2025-11-27 5055/week @ 2025-12-04 3992/week @ 2025-12-11 3375/week @ 2025-12-18 2351/week @ 2025-12-25 3984/week @ 2026-01-01 5521/week @ 2026-01-08

15,830 downloads per month
Used in 40 crates (14 directly)

MIT/Apache

260KB
4.5K SLoC

Nearest Neighbor

linfa-nn provides a pure Rust implementation of nearest neighbor algorithms.

The Big Picture

linfa-nn is a crate in the linfa ecosystem, an effort to create a toolkit for classical Machine Learning implemented in pure Rust, akin to Python's scikit-learn.

Nearest neighbor search (NNS), as a form of proximity search, is the optimization problem of finding the point in a given set that is closest (or most similar) to a given point. Closeness is typically expressed in terms of a dissimilarity function: the less similar the objects, the larger the function values.

Current State

linfa-nn currently provides the following implementations: - linear - balltree - KDTree

License

Dual-licensed to be compatible with the Rust project.

Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 or the MIT license http://opensource.org/licenses/MIT, at your option. This file may not be copied, modified, or distributed except according to those terms.

Dependencies

~5MB
~96K SLoC