rust-ndarray VS linfa

Compare rust-ndarray vs linfa and see what are their differences.


ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations (by rust-ndarray)


A Rust machine learning framework. (by rust-ml)
Our great sponsors
  • OPS - Build and Run Open Source Unikernels
  • Scout APM - Less time debugging, more time building
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
rust-ndarray linfa
8 9
2,061 1,408
4.2% 8.2%
9.0 7.8
4 days ago 8 days ago
Rust Rust
GNU General Public License v3.0 or later GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.


Posts with mentions or reviews of rust-ndarray. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-12-12.
  • Enzyme: Towards state-of-the-art AutoDiff in Rust
    3 projects | | 12 Dec 2021
    I don't think any of the major ML projects have GPU acceleration because ndarray doesn't support it.
  • Announcing Rust CUDA 0.2
    3 projects | | 5 Dec 2021
    Not sure about ndarray:
  • Signal processing library
    7 projects | | 6 Nov 2021
    I used basic_dsp a while back and found it lacking. I was hoping to find something that uses the ndarray datatype but i'm not seeing this yet. If you're primarily trying to learn though it might not really matter which library you contribute to. As for myself, I just picked the one that was most used and actively worked on at the time. However I keep an eye out on other libraries; if I see something take off, I might switch over. Either way you'll learn and can point to it as work accomplished.
  • Searching help for Rust Image Manipulation
    2 projects | | 31 Jul 2021
    Most libraries use either an older C/C++ dynamically or statically. I was looking into maybe rewriting some image manipulation functions in Rust using ndarray (which would then allow for both hardware, gpu and multithreading acceleration), but it would take a very long to get fully into the subject.
  • Dumb question: I want to overload operators like add on structs, what is the name for what I'm trying to do?
    3 projects | | 30 Apr 2021
    The best way would to use a crate for this, such as ndarray, which provides some good ways to do this.
  • Making Maintaining Easier
    5 projects | | 25 Apr 2021
    First, let me explain a crate, where old dependencies do matter. There is one very handy crate called nshare. It's used for converting images into ndarrays. The libraries between nshare converts are regularly updated, for example to support new formats or to make the usage more convenient. If one writes a new software there could be conflicts in versions of ndarray (for example), so we make sure, that nshare is always up-to-date and works with the newest versions in order to build the best code on it. Another example could be everything cryptographic. If there would be a security issue with ring we really want every dependent to be updated.
  • Linfa has a website now!
    4 projects | | 8 Mar 2021
    well you can represent categorical values in `ndarray` for sure (even structured arrays [here](, but the memory has to be contiguous for BLAS/LAPACK and therefore it is impossible to mix continuous and categorical values. I was thinking that we could emulate categorical values with a descriptor field for the type of each feature and then just use floats to represent them.
  • ndarray: Apply along axis
    2 projects | | 6 Mar 2021
    ndarray Readme links to matrix


Posts with mentions or reviews of linfa. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-12-04.
  • Any role that Rust could have in the Data world (Big Data, Data Science, Machine learning, etc.)?
    8 projects | | 4 Dec 2021
  • How far along is the ML ecosystem with Rust?
    6 projects | | 15 Sep 2021
    For other algorithms, there is not yet a single library to rule them all (linfa might become that at some point) but searching for the algorithm you need on is likely to give you some results (obligatory plug to Friedrich, my gaussian process implementation).
    6 projects | | 15 Sep 2021
    I'm working on machine learning in Rust at Tangram. We currently only provide an implementation of linear models and gradient boosted decision trees but will move into exposing training of deep models in the future. You can check out Tangram here: You may also be interested in checking out Linfa If you're interested in the future of machine learning in Rust, check out Luca Palmieri's blog post:
  • Linfa: A Rust machine learning framework
    1 project | | 1 Aug 2021
  • AII4DEVS #10: Diverse knowledge is the key to grow the next generation of ML practitioners into AI engineers.
    1 project | | 4 Jul 2021
    To all folks in love with Rust programming language, **linfa** is a promising library to check out: a complete porting of the well known scikit-learn library, which enables common preprocessing tasks and classical ML algorithms such as clustering, linear learners, logistic regression, and decision trees as well as support vector machines and Bayesian algorithms such as Naive Bayes. We all know that Python has the 98% of the machine learning languages market share, but if I looked to something else, a super-fast Rust implementation would be my first stop.
  • Linfa has a website now!
    4 projects | | 8 Mar 2021
    for a start I will implement the TryFrom for Dataset under a feature flag. But to be really useful some of the algorithms have to start using something like DatasetBase here Records are currently bounded by an associated type for the element type, we would have to relax that too. Just read your blogpost on polars 👍
    4 projects | | 8 Mar 2021
    to here:
  • Linfa release 0.3.0 - Elasticnet, approximated DBSCAN and Gaussian Naive Bayes + improvements
    3 projects | | 20 Jan 2021
    recently I had looked at the linfa decision trees code. in linfa, the decision tree is made up of nodes with left/right child as an Option> reference to its children nodes:
    3 projects | | 20 Jan 2021

What are some alternatives?

When comparing rust-ndarray and linfa you can also consider the following projects:

image - Encoding and decoding images in Rust

neuronika - Tensors and dynamic neural networks in pure Rust.

tangram - Tangram makes it easy for programmers to train, deploy, and monitor machine learning models.

Enzyme - High-performance automatic differentiation of LLVM.

utah - Dataframe structure and operations in Rust

tch-rs - Rust bindings for the C++ api of PyTorch.

nalgebra - Linear algebra library for Rust.

gbdt-rs - MesaTEE GBDT-RS : a fast and secure GBDT library, supporting TEEs such as Intel SGX and ARM TrustZone

traceroute - Rust traceroute

rust-dsp - A library for sound Digital Signal Processing, written in Rust

dasp - The fundamentals for Digital Audio Signal Processing. Formerly `sample`.

rusty-machine - Machine Learning library for Rust