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
  • ONLYOFFICE ONLYOFFICE Docs — document collaboration in your environment
  • SonarQube - Static code analysis for 29 languages.
  • InfluxDB - Access the most powerful time series database as a service
rust-ndarray linfa
19 14
2,809 2,670
2.1% 4.1%
6.6 5.8
7 days ago about 1 month ago
Rust Rust
Apache License 2.0 Apache License 2.0
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 2023-04-21.
  • faer 0.8.0 release
    6 projects | | 21 Apr 2023
    Sadly Ndarray does look a little abandoned to me:
  • Status and Future of ndarray?
    2 projects | | 3 Apr 2023
    The date of the last commit of [ndarray]( lies 6 month in the past while many recent issues are open and untouched.
  • Announcing Burn: New Deep Learning framework with CPU & GPU support using the newly stabilized GAT feature
    7 projects | | 6 Nov 2022
    Burn is different: it is built around the Backend trait which encapsulates tensor primitives. Even the reverse mode automatic differentiation is just a backend that wraps another one using the decorator pattern. The goal is to make it very easy to create optimized backends and support different devices and use cases. For now, there are only 3 backends: NdArray ( for a pure rust solution, Tch ( for an easy access to CUDA and cuDNN optimized operations and the ADBackendDecorator making any backend differentiable. I am now refactoring the internal backend API to make it as easy as possible to plug in new ones.
  • Pure rust implementation for deep learning models
    3 projects | | 9 Oct 2022
    Looks like it's an open request
  • The Illustrated Stable Diffusion
    3 projects | | 4 Oct 2022

    Answer: you can’t with this crate. I implemented a dynamic n-dim solution myself but it uses views of integer indices that get copied to a new array, which have indexes to another flattened array in order to avoid duplication of possibly massive amounts of n-dimensional data; using the crate alone, copying all the array data would be unavoidable.

    Ultimately I’ve had to make my own axis shifting and windowing mechanisms. But the crate is still a useful lib and continuing effort.

    While I don’t mind getting into the weeds, these kinds of side efforts can really impact context focus so it’s just something to be aware of.

  • Any efficient way of splitting vector?
    2 projects | | 12 Sep 2022
    In principle you're trying to convert between columnar and row-based data layouts, something that happens fairly often in data science. I bet there's some hyper-efficient SIMD magic that could be invoked for these slicing operations (and maybe the iterator solution does exactly that). Might be worth taking a look at how the relevant Rust libraries like ndarray do it.
  • Rust or C/C++ to learn as a secondary language?
    6 projects | | 9 Feb 2022
    ndarray and numpy crates provide good way to operate on numpy ndarrays from python
  • 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.


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 2022-11-13.
  • Why is Rust not more popular in ML and secure edge computing?
    2 projects | | 13 Nov 2022
  • Polars vs ndarray performance
    2 projects | | 16 Oct 2022
    I've been playing with data analytics and ml in rust for the last couple of weeks. A typical ML job requires transforming some data to feed the ml model to the then train the model. For ML I've been using linfa ( which is surprisingly nice. I've been experimenting with ndarray and polars for data transformation (linfa uses ndarray) - from a UX standpoint. I'm pretty surprised by polars' performance (, which sits on top of arrow2, and it's definitely a great candidate for OLAP tasks. But I couldn't find any comparison between ndarray and polars, has anyone had any meaningful experience with the two or/and can point me to a benchmark comparison?
  • Ask HN: What is the job market like, for niche languages (Nim, crystal)?
    4 projects | | 23 Jul 2022
    The most comprehensive current view of the Rust machine learning ecosystem at the moment is probably at (I sometimes help maintain this site)

    Rust has a weird mix at the moment, and not one that's likely to significantly change within the next 12 months, at least. Certain tools are genuinely best-in-class, especially around simple operations on insane amounts of data. Rust kills it in that space due to its native speed and focus on concurrency.

    There's also growing projects like Linfa [1]. that while not at the level of scikit-learn, have significantly increased their coverage on common data science/classical ML problems in the past couple years, along with improved tooling. The space does have a few pure-Rust projects coming down the pipeline around autodifferentiation, GPU compute, etc. that are likely to yield some really valuable results in deep learning, but that aren't quite available and will take some time to pick up some traction even once they're released. At the same time, areas like data visualization are unlikely to reach parity with something like matplotlib/pyplot in the near future.

    Python is the de-facto standard, and will be for some time, but Rust's ability to build accessible high-level APIs on top of performant, language-native libraries is attracting some attention and I wouldn't be surprised to start seeing ingress in the certain areas over the next few years, where instead of the Python/C++ combination, it's just Rust all the way down.


  • Is RUST aiming to build an ecosystem on scientific computing?
    6 projects | | 10 Jul 2022
    take a look at for machine learning related crates
  • What is a FOSS which is needed but doesn't exist yet/needs contributers?
    7 projects | | 16 Feb 2022
    Check out smartcore and linfa. At work I was badly in need of an NMF function similar to MATLAB's one these days but not enough time to write one myself. If you're good at math and machine learning, this sounds like a task you could try tackling.
  • 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 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:

What are some alternatives?

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

nalgebra - Linear algebra library for Rust.

Rust-CUDA - Ecosystem of libraries and tools for writing and executing fast GPU code fully in Rust.

smartcore - A comprehensive library for machine learning and numerical computing. The library provides a set of tools for linear algebra, numerical computing, optimization, and enables a generic, powerful yet still efficient approach to machine learning.

image - Encoding and decoding images in Rust

neuronika - Tensors and dynamic neural networks in pure Rust.

utah - Dataframe structure and operations in Rust

Awesome-Rust-MachineLearning - This repository is a list of machine learning libraries written in Rust. It's a compilation of GitHub repositories, blogs, books, movies, discussions, papers, etc. 🦀

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

nshare - Provides an interface layer to convert between n-dimensional types in different Rust crates

Enzyme - High-performance automatic differentiation of LLVM and MLIR.

rusty-machine - Machine Learning library for Rust

PySCIPOpt - Python interface for the SCIP Optimization Suite