Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

rustlearn

> 编程语言
Open source

Machine learning crate for Rust

645 stars0 likes2 views
WebsiteGitHub

About

Machine learning crate for Rust

rustlearn

A machine learning package for Rust.

For full usage details, see the API documentation.

Introduction

This crate contains reasonably effective implementations of a number of common machine learning algorithms.

At the moment, rustlearn uses its own basic dense and sparse array types, but I will be happy to use something more robust once a clear winner in that space emerges.

Features

Matrix primitives

  • dense matrices
  • sparse matrices

Models

  • logistic regression using stochastic gradient descent,
  • support vector machines using the libsvm library,
  • decision trees using the CART algorithm,
  • random forests using CART decision trees, and
  • factorization machines.

All the models support fitting and prediction on both dense and sparse data, and the implementations should be roughly competitive with Python sklearn implementations, both in accuracy and performance.

Cross-validation

  • k-fold cross-validation
  • shuffle split

Metrics

  • accuracy
  • ROC AUC score
  • dcg_score
  • ndcg_score
  • mean absolute error
  • mean squared error

Parallelization

A number of models support both parallel model fitting and prediction.

Model serialization

Model serialization is supported via serde.

Using rustlearn

Usage should be straightforward.

  • import the prelude for all the linear algebra primitives and common traits:
rust
use rustlearn::prelude::*;
  • import individual models and utilities from submodules:
rust
use rustlearn::prelude::*;

use rustlearn::linear_models::sgdclassifier::Hyperparameters;
// more imports

Examples

Logistic regression

…

Random forest

…

Contributing

Pull requests are welcome.

To run basic tests, run cargo test.

Running cargo test --features "all_tests" --release runs all tests, including generated and slow tests. Running cargo bench --features bench (only on the nightly branch) runs benchmarks.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言