linfa

Library Featured

A Machine Learning framework for Rust

Checked · Sources

Downloads
177,963
Dependents
60
Stars
4,770
Forks
331
Contributors
63
Commits
382
Latest release
0.8.1 ·

About

From the project README ·

Linfa mascot icon

linfa (Italian) / sap (English):

The vital circulating fluid of a plant.

linfa aims to provide a comprehensive toolkit to build Machine Learning applications with Rust.

Kin in spirit to Python's scikit-learn, it focuses on common preprocessing tasks and classical ML algorithms for your everyday ML tasks.

Website | Community chat

Current state

Where does linfa stand right now? Are we learning yet?

linfa currently provides sub-packages with the following algorithms:

Read the full README
NamePurposeStatusCategoryNotes
bayesNaive BayesTestedSupervised learningContains Bernouilli, Gaussian and Multinomial Naive Bayes
clusteringData clusteringTested / BenchmarkedUnsupervised learningClustering of unlabeled data; contains K-Means, Gaussian-Mixture-Model, DBSCAN and OPTICS
ensembleEnsemble methodsTestedSupervised learningContains bagging, random forest and AdaBoost
elasticnetElastic NetTestedSupervised learningLinear regression with elastic net constraints
ftrlFollow The Regularized Leader - proximalTested / BenchmarkedPartial fitContains L1 and L2 regularization. Possible incremental update
hierarchicalAgglomerative hierarchical clusteringTestedUnsupervised learningCluster and build hierarchy of clusters
icaIndependent component analysisTestedUnsupervised learningContains FastICA implementation
kernelKernel methods for data transformationTestedPre-processingMaps feature vector into higher-dimensional space
larsLinear regressionTestedSupervised learningContains Least Angle Regression (LARS)
linearLinear regressionTestedSupervised learningContains Ordinary Least Squares (OLS), Generalized Linear Models (GLM)
logisticLogistic regressionTestedPartial fitBuilds two-class logistic regression models
nnNearest Neighbours & DistancesTested / BenchmarkedPre-processingSpatial index structures and distance functions
plsPartial Least SquaresTestedSupervised learningContains PLS estimators for dimensionality reduction and regression
preprocessingNormalization & VectorizationTested / BenchmarkedPre-processingContains data normalization/whitening and count vectorization/tf-idf
reductionDimensionality reductionTestedPre-processingDiffusion mapping, Principal Component Analysis (PCA), Random projections
svmSupport Vector MachinesTestedSupervised learningClassification or regression analysis of labeled datasets
treesDecision treesTested / BenchmarkedSupervised learningLinear decision trees
tsneDimensionality reductionTestedUnsupervised learningContains exact solution and Barnes-Hut approximation t-SNE

We believe that only a significant community effort can nurture, build, and sustain a machine learning ecosystem in Rust - there is no other way forward.

If this strikes a chord with you, please take a look at the roadmap and get involved!

Browser WASM

For browser-style WASM on wasm32-unknown-unknown, enable linfa's wasm-bindgen feature.

BLAS/Lapack backend

Some algorithm crates need to use an external library for linear algebra routines. By default, we use a pure-Rust implementation. However, you can also choose an external BLAS/LAPACK backend library instead, by enabling the blas feature and a feature corresponding to your BLAS backend. Currently you can choose between the following BLAS/LAPACK backends: openblas, netblas or intel-mkl.

BackendLinuxWindowsmacOS
OpenBLAS✔️--
Netlib✔️--
Intel MKL✔️✔️✔️

Each BLAS backend has two features available. The feature allows you to choose between linking the BLAS library in your system or statically building the library. For example, the features for the intel-mkl backend are intel-mkl-static and intel-mkl-system.

An example set of Cargo flags for enabling the Intel MKL backend on an algorithm crate is --features blas,linfa/intel-mkl-system. Note that the BLAS backend features are defined on the linfa crate, and should only be specified for the final executable.

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.

Runs on
GPU support unknown
What shows it
  • no dependency or feature matches a backend row
Native code
Optional
  • Binds native code: lapack-sys (feature intel-mkl-static)
Python bindings
No Python binding crate found
License
Apache-2.0 OR MIT

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.

linfa beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
linfa This page Featured

A Machine Learning framework for Rust

177,963 downloads over 30 days 60 4,770 0.8.1 GPU support unknown Binds native code: lapack-sys (feature intel-mkl-static) Apache-2.0 OR MIT
smartcore Featured

Machine Learning in Rust.

39,473 downloads over 30 days 33 976 0.7.0 GPU support unknown No native code found Apache-2.0
rustlearn Listed Dormant

A machine learning package for Rust.

578 downloads over 30 days 2 647 0.5.0 GPU support unknown Binds native code: libsvm Apache-2.0

Automated machine learning for classification and regression

170 downloads over 30 days 1 39 0.3.1 GPU support unknown No native code found Apache-2.0 OR MIT
treeboost Listed

Gradient-boosted decision trees for tabular data: trains a baseline model in one call, with full control over boosting modes and configs, and Scalar, AVX-512, SVE2, WGPU and CUDA backends.

Python bindings

18 downloads over 30 days 0 9 0.1.2 CUDA, WebGPU No native code found Apache-2.0
fwumious_wabbit App Listed Dormant

Fwumious Wabbit, fast on-line machine learning toolkit written in Rust

0 binary downloads per release Not applicable 141 Not measured Not measured Not measured
craftml-rs App Archived

A Rust🦀 implementation of CRAFTML, an Efficient Clustering-based Random Forest for Extreme Multi-label Learning

Not measured Not applicable 15 Not measured Not measured Not measured MIT
Why FeaturedIt passes every Featured gate.

What it meets

  • It has 29 active dependents and 20 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days.
  • Active dependents are at 95% of their peak. Featured needs at least 50%.
  • Docs are present. The release commit or a manifest ties the crate to the repository.
  • No vulnerability advisory stays unpatched past the grace window. At least one version is neither a prerelease nor 0.0.x.
  • The last activity is on 22 Aug 2026, 79 days ago. The rules expect an update within 1200 days. Dormancy rule

Exact rules: Featured library. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: version 0.8.1 base 300, doubled for 177963 downloads per month, doubled for 28.5 active users: E = 1200 days
  • dormancy: last activity 2026-08-22, 79 days ago, E = 1200: active
  • featured: featured: active_users 28.5, new_adopters 19.5, former_glory 0.95
Crates20 crates

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources6 sources
Adoption29 active dependents, 20 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents28.5crates.io database dumpYes
New dependents (365 days)19.5crates.io database dumpYes
Peak active dependents31.5crates.io database dumpYes
Active dependents as a share of the peak0.9518crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 2 months ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-08-22GitHub repositoryYes
Latest release2025-12-23crates.io database dumpYes
First release2018-04-05crates.io database dumpYes
Latest version0.8.1crates.io database dumpYes
Days the oldest outside issue waits for a reply966GitHub repositoryYes
Maintainer replies over 365 days21GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution15 releases, 177,963 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases15crates.io database dumpYes
Downloads over 30 days177963crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository4,770 stars, 331 forks, 63 contributors, 382 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars4770GitHub repositoryYes — one part of the repository route
GitHub forks331GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account63GitHub contributorsYes — one part of the repository route
Commits on the default branch382GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseApache-2.0 OR MITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesBinds native code: lapack-sys (feature intel-mkl-static)crates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly60crates.io database dumpNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.