12 releases (6 breaking)

0.8.1 Dec 23, 2025
0.8.0 Sep 30, 2025
0.7.1 Jan 14, 2025
0.7.0 Oct 16, 2023
0.2.1 Nov 29, 2020

#997 in Machine learning

Download history 767/week @ 2025-09-20 1985/week @ 2025-09-27 1161/week @ 2025-10-04 1994/week @ 2025-10-11 1703/week @ 2025-10-18 1467/week @ 2025-10-25 1660/week @ 2025-11-01 1249/week @ 2025-11-08 1530/week @ 2025-11-15 1191/week @ 2025-11-22 1281/week @ 2025-11-29 1376/week @ 2025-12-06 1881/week @ 2025-12-13 1991/week @ 2025-12-20 1512/week @ 2025-12-27 1885/week @ 2026-01-03

7,516 downloads per month
Used in 6 crates

MIT/Apache

295KB
5.5K SLoC

Linear Models

linfa-linear aims to provide pure Rust implementations of popular linear regression algorithms.

The Big Picture

linfa-linear 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.

Current state

linfa-linear currently provides an implementation of the following regression algorithms:

  • Ordinary Least Squares
  • Generalized Linear Models (GLM)

Examples

There is an usage example in the examples/ directory. To run, use:

$ cargo run --example diabetes
$ cargo run --example glm

BLAS/Lapack backend

See this section to enable an external BLAS/LAPACK backend.

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

~4–14MB
~216K SLoC