rust-ndarray VS linfa

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

rust-ndarray

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

linfa

A Rust machine learning framework. (by rust-ml)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
rust-ndarray linfa
20 14
3,235 3,316
2.6% 3.8%
7.4 6.9
5 days ago 15 days 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.

rust-ndarray

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-09-22.
  • Some Reasons to Avoid Cython
    5 projects | news.ycombinator.com | 22 Sep 2023
    I would love some examples of how to do non-trivial data interop between Rust and Python. My experience is that PyO3/Maturin is excellent when converting between simple datatypes but conversions get difficult when there are non-standard types, e.g. Python Numpy arrays or Rust ndarrays or whatever other custom thing.

    Polars seems to have a good model where it uses the Arrow in memory format, which has implementations in Python and Rust, and makes a lot of the ndarray stuff easier. However, if the Rust libraries are not written with Arrow first, they become quite hard to work with. For example, there are many libraries written with https://github.com/rust-ndarray/ndarray, which is challenging to interop with Numpy.

    (I am not an expert at all, please correct me if my characterizations are wrong!)

  • faer 0.8.0 release
    6 projects | /r/rust | 21 Apr 2023
    Sadly Ndarray does look a little abandoned to me: https://github.com/rust-ndarray/ndarray
  • Status and Future of ndarray?
    2 projects | /r/rust | 3 Apr 2023
    The date of the last commit of [ndarray](https://github.com/rust-ndarray/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 | /r/rust | 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 (https://github.com/rust-ndarray/ndarray) for a pure rust solution, Tch (https://github.com/LaurentMazare/tch-rs) 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 | /r/rust | 9 Oct 2022
    Looks like it's an open request
  • The Illustrated Stable Diffusion
    3 projects | news.ycombinator.com | 4 Oct 2022
    https://github.com/rust-ndarray/ndarray/issues/281

    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 | /r/rust | 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 | /r/Python | 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 | /r/rust | 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 | /r/rust | 5 Dec 2021
    Not sure about ndarray: https://github.com/rust-ndarray/ndarray/issues/840

linfa

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 | /r/rust | 13 Nov 2022
  • Polars vs ndarray performance
    2 projects | /r/rust | 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 (https://github.com/rust-ml/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 (https://h2oai.github.io/db-benchmark/), 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 | news.ycombinator.com | 23 Jul 2022
    The most comprehensive current view of the Rust machine learning ecosystem at the moment is probably at https://www.arewelearningyet.com/ (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.

    [1] https://github.com/rust-ml/linfa

  • Is RUST aiming to build an ecosystem on scientific computing?
    6 projects | /r/rust | 10 Jul 2022
    take a look at https://github.com/rust-ml/linfa for machine learning related crates
  • What is a FOSS which is needed but doesn't exist yet/needs contributers?
    7 projects | /r/rust | 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 | /r/rust | 4 Dec 2021
  • How far along is the ML ecosystem with Rust?
    6 projects | /r/rust | 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 crate.io is likely to give you some results (obligatory plug to Friedrich, my gaussian process implementation).
    6 projects | /r/rust | 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: https://github.com/tangramdotdev/tangram. You may also be interested in checking out Linfa https://github.com/rust-ml/linfa. If you're interested in the future of machine learning in Rust, check out Luca Palmieri's blog post: https://www.lpalmieri.com/posts/2019-12-01-taking-ml-to-production-with-rust-a-25x-speedup/
  • Linfa has a website now!
    4 projects | /r/rust | 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 | /r/rust | 8 Mar 2021
    to here: https://github.com/rust-ml/linfa/tree/master/linfa-svm/examples

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.

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. 🦀

utah - Dataframe structure and operations in Rust

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

rusty-machine - Machine Learning library for Rust

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

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

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