Skip to content

Rust implementation of the MeanShift Clustering Algorithm (with Python Bindings) [Mirror]

Notifications You must be signed in to change notification settings

wenig/meanshift-rs

Repository files navigation

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)

About

Rust implementation of the MeanShift Clustering Algorithm (with Python Bindings) [Mirror]

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published