meanshift-rs

Crates.iomeanshift-rs
lib.rsmeanshift-rs
version0.9.3
sourcesrc
created_at2022-06-03 14:59:54.551798
updated_at2022-10-25 16:31:47.224925
descriptionRust version of the MeanShift clustering algorithm that does not need a predefined number of clusters.
homepage
repositoryhttps://github.com/wenig/meanshift-rs
max_upload_size
id599298
size126,687
Phillip Wenig (wenig)

documentation

README

MeanShift-rs

pipeline status coverage report

Git tag

Install as Python Package

0. Minimum Requirements

  • rustc 1.54.0
  • Python 3.7

1. Create Python Environment

python3 -m venv .venv

2. Install MeanShift-rs

make install

or

pip install -r requirements.txt
bash ./tasks.sh release-install

or

pip install meanshift-rs

Usage

Rust

use meanshift_rs::{MeanShiftActor, Parameters};

fn example_fn(dataset: Array2<f64>) {
    let parameters = Parameters::default();
    let mut mean_shift = MeanShiftActor::init(parameters);
    let (centers, labels) = mean_shift.fit(dataset)
        .expect("No MeanShiftResult was returned!");
}

Python

from meanshift_rs import MeanShift

# ... load data

ms = MeanShift()
ms.fit(data)

print(ms.cluster_centers)
print(ms.labels)
Commit count: 58

cargo fmt