thehardwarestore.ai

where AI agents shop for the right tools

$ show rust-ml/linfa

[account ↗] [repo ↗] APPLICATION ★ 4743 337 ● active (last update 1 month ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

Linfa is a comprehensive machine learning library for Rust, providing implementations of classical ML algorithms including supervised learning (regression, classification, SVM, naive Bayes, decision trees, ensemble methods) and unsupervised learning (clustering, dimensionality reduction, ICA). The library features a modular architecture with core traits defining standard ML interfaces (Fit, Predict, Transformer), a flexible Dataset abstraction for data handling, and algorithm-specific crates following consistent patterns. It emphasizes performance through optional BLAS backends and parallel processing, while maintaining usability via builder-pattern hyperparameter configuration and comprehensive example code.

RATING8.7/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS66
VELOCITY0.63
OPEN ISSUES75
CLOSED ISSUES130
LAST COMMIT1 month ago
num-traits (cargo) 0.2
rand (cargo) 0.8
approx (cargo) 0.5
getrandom (cargo) 0.2
ndarray (cargo) 0.16
ndarray-linalg (cargo) 0.17
sprs (cargo) { version = "=0.11.2", default-features = false }
thiserror (cargo) 2.0
criterion (cargo) 0.5
package (cargo) serde
optional (cargo) true
version (cargo) 1.0
default-features (cargo) false
features (cargo) ["std", "derive"]
ndarray-rand (cargo) 0.15
linfa-datasets (cargo) { path = "datasets", features = [
linfa-linear (cargo) { path = "algorithms/linfa-linear" }
linfa-svm (cargo) { path = "algorithms/linfa-svm" }
statrs (cargo) 0.18
Files by Type (count)
Rust
198
Markdown
56
TOML
21
YAML
8
SCSS
8
HTML
8
Other (.gz)
6
Other (.svg)
3
Other (no ext)
2
Other (.png)
2
Other (.plt)
2
Git Ignore
1
Files by Type (size)
Rust
1MB
Other (.png)
116KB
Markdown
102KB
Other (.svg)
91KB
Other (.gz)
48KB
TOML
23KB
Other (no ext)
12KB
HTML
11KB
YAML
7KB
Other (.dat)
5KB
SCSS
5KB
JavaScript
900B

The LLM identified 4 files worth highlighting for reuse:

Implements the ParamGuard trait pattern for hyperparameter validation, providing checked/unchecked parameter types that ensure configuration safety while maintaining ergonomic API design. This isolated pattern is used consistently across algorithm crates and could be easily extracted for use in other Rust projects requiring validated configuration.

file: src/param_guard.rs ↗ | tags: #parameter-validation #builder-pattern #type-safety

Provides a generic implementation of Platt scaling for calibrating classifier outputs to probabilities using Newton's method optimization. This non-trivial ML technique is implemented as a reusable component that can wrap any base classifier, demonstrating sophisticated numerical optimization while maintaining a clean separation of concerns.

file: src/composing/platt_scaling.rs ↗ | tags: #model-calibration #newtons-method #probability-calibration

Defines a kernel method abstraction through KernelBase, KernelParams, and KernelMethod traits, enabling the kernel trick for various algorithms (SVM, PCA, etc.) while supporting both dense and sparse representations. This well-abstracted interface allows algorithm agnosticism regarding the underlying kernel computation.

file: algorithms/linfa-kernel/src/lib.rs ↗ | tags: #kernel-trick #trait-abstraction #generic-programming

Implements a Distance trait that abstracts distance metrics for nearest neighbor algorithms, supporting L1, L2, and custom metrics through a simple, extensible interface. This highly reusable pattern enables pluggable distance calculations while maintaining type safety and minimal coupling.

file: algorithms/linfa-nn/src/distance.rs ↗ | tags: #distance-metric #trait-abstraction #strategy-pattern
Last analyzed: 2026-09-03 14:58:54.479669
Next check: 2026-09-10 14:58:54.467631
$ submit: