rusticsom
Library Listed Dormant
Rust library for Self Organising Maps (SOM).
- Downloads
- 9
- Dependents
- 0
- Stars
- 36
- Forks
- 6
- Contributors
- 5
- Commits
- 48
- Latest release
- 1.1.1 ·
About
Rust library for Self Organising Maps (SOM).
Using this Crate
Add rusticsom as a dependency in Cargo.toml
[dependencies]
rusticsom = "1.1.0"
Include the crate
use rusticsom::SOM;
API
Use SOM::create to create an SOM object using the API call below, which creates an SOM with length x breadth cells and accepts neurons of length inputs.
pub fn create(length: usize, breadth: usize, inputs: usize, randomize: bool, learning_rate: Option<f32>, sigma: Option<f32>, decay_function: Option<fn(f32, u32, u32) -> f64>, neighbourhood_function: Option<fn((usize, usize), (usize, usize), f32) -> Array2<f64>>) -> SOM { ... }
randomize is a flag, which, if true, initializes the weights of each cell to random, small, floating-point values.
learning_rate, optional, is the learning_rate of the SOM; by default it will be 0.5.
sigma, optional, is the spread of the neighbourhood function; by default it will be 1.0.
decay_function, optional, is a function pointer that accepts functions that take 3 parameters of types f32, u32, u32, and returns an f64. This function is used to "decay" both the learning_rate and sigma. By default it is
new_value = old_value / (1 + current_iteration/total_iterations)
Read the full README
neighbourhood_function, optional, is also a function pointer that accepts functions that take 3 parameters, a tuple of type (usize, usize) representing the size of the SOM, another tuple of type (usize, usize) representing the position of the winner neuron, and an f32 representing sigma; and returns a 2D Array containing weights of the neighbours of the winning neuron, i.e, centered at winner. By default, the Gaussian function will be used, which returns a "Gaussian centered at the winner neuron".
pub fn from_json(serialized: &str, decay_function: Option<fn(f32, u32, u32) -> f64>, neighbourhood_function: Option<fn((usize, usize), (usize, usize), f32) -> Array2<f64>>) -> serde_json::Result<SOM> { ... }
This function allows to create a SOM from a previously exported SOM json data using SOM::to_json().
Use SOM_Object.train_random() to train the SOM with the input dataset, where samples from the input dataset are picked in a random order.
pub fn train_random(&mut self, data: Array2<f64>, iterations: u32) { ... }
Samples (rows) from the 2D Array data are picked randomly and the SOM is trained for iterations iterations!
Use SOM_Object.train_batch() to train the SOM with the input dataset, where samples from the input dataset are picked in a sequential order.
pub fn train_batch(&mut self, data: Array2<f64>, iterations: u32) { ... }
Samples (rows) from the 2D Array data are picked sequentially and the SOM is trained for iterations iterations!
Use SOM_Object.winner() to find the winning neuron for a given sample.
pub fn winner(&mut self, elem: Array1<f64>) -> (usize, usize) { ... }
This function must be called with an SOM object.
Requires one parameter, a 1D Array of f64s representing the input sample.
Returns a tuple (usize, usize) representing the x and y coordinates of the winning neuron in the SOM.
Use SOM_Object.winner_dist() to find the winning neuron for a given sample, and it's distance from this winner neuron.
pub fn winner_dist(&mut self, elem: Array1<f64>) -> ((usize, usize), f64) { ... }
This function must be called with an SOM object.
Requires one parameter, a 1D Array of f64s representing the input sample.
Returns a tuple (usize, usize) representing the x and y coordinates of the winning neuron in the SOM.
Also returns an f64 representing the distance of the input sample from this winner neuron.
pub fn activation_response(&self) -> ArrayView2<usize> { ... }
This function returns the activation map of the SOM. The activation map is a 2D Array where each cell at (i, j) represents the number of times the (i, j) cell of the SOM was picked to be the winner neuron.
pub fn get_size(&self) -> (usize, usize)
This function returns a tuple representing the size of the SOM. Format is (length, breadth).
pub fn distance_map(self) -> Array2<f64> { ... }
Returns the distance map of the SOM, i.e, the normalized distance of every neuron with every other neuron.
pub fn to_json(&self) -> serde_json::Result<String> { ... }
Returns the internal SOM data as pretty printed json (using serde_json).
Primary Contributors
Example
We've tested this crate on the famous iris dataset (present in csv format in the extras folder).
The t_full_test function in /tests/test.rs was used to produce the required output. The following plots were obtained using matplotlib for Python.
Using a 5 x 5 SOM, trained for 250 iterations :

Using a 10 x 10 SOM, trained for 1000 iterations :

| Symbol | Represents |
|---|---|
| Circle | setosa |
| Square | versicolor |
| Diamond | virginica |
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- 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.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
Rust library for Self Organising Maps (SOM). |
9 downloads over 30 days | 0 | 36 | 1.1.1 | GPU support unknown | No native code found | MIT |
|
linfa 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 |
|
leiden-rs Listed
High-performance Leiden community detection algorithm for graphs in Rust |
41,983 downloads over 30 days | 10 | Not measured | 0.8.1 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
anofox-regression Listed
A robust statistics library for regression analysis |
8,310 downloads over 30 days | 6 | 8 | 0.12.2 | GPU support unknown | No native code found | MIT |
|
radiate Listed
A Rust library for genetic algorithms and artificial evolution. Python bindings |
971 downloads over 30 days | 0 | 257 | 1.3.2 | GPU support unknown | No native code found | MIT |
|
Rust bindings for the liblinear C++ library |
922 downloads over 30 days | 1 | 10 | 1.0.0 | GPU support unknown | Binds native code: liblinear.a. Build uses a native toolchain: cc | 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 |
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 0 active dependents and 0 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 36 stars, 6 forks and 5 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
- The project is dormant and not finished. Dormancy rule
What else the check found
- The last activity is on 7 Oct 2020, 2224 days ago. That reaches the 365 days the rules expect, so the project is dormant. Dormancy rule
- The oldest outside issue waits 2217 days for a reply, past the limit of 270. No maintainer replied in 365 days. Rot signals rule
Not measured: Latest release fails cargo check.
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 1.1.1 base 300, capped at 3 releases = 150, raised to the 365-day floor: E = 365 daysdormancy: last activity 2020-10-07, 2224 days ago, E = 365: dormantrot: oldest unanswered issue 2217 days (limit 270), no maintainer reply in 365 daysfeatured: not featured: active_users 0 < 11 and new_adopters 0 < 9 and repository route stars 36 (needs 4539), forks 6 (needs 434), contributors 5 (needs 79); dormant and not stablelisted: listed: no archive, new or featured rule applies
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
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption0 active dependents, 0 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 0 | crates.io database dump | Yes | |
| New dependents (365 days) | 0 | crates.io database dump | Yes | |
| Peak active dependents | 0 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 6 years ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2020-10-07 | GitHub repository | Yes | |
| Latest release | 2020-04-01 | crates.io database dump | Yes | |
| First release | 2018-03-10 | crates.io database dump | Yes | |
| Latest version | 1.1.1 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 2217 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 0 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution3 releases, 9 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 3 | crates.io database dump | Yes | |
| Downloads over 30 days | 9 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository36 stars, 6 forks, 5 contributors, 48 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 36 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 6 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 5 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 48 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 0 | crates.io database dump | No |
Corrections and review history
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.