Skip to content

ramintoosi/kmeans-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple implementation of KMeans algorithm in Rust

This repository contains a simple implementation of the KMeans algorithm in Rust, created for my practice. Use it carefully!

How to use

  1. Clone and build with cargo
git clone https://github.com/ramintoosi/kmeans-rust
cd kmeans-rust/
cargo build --release
  1. Use the app
>> target/release/kmeans -h

A simple implementation of KMeans algorithm.

Usage: kmeans [OPTIONS] --data-path <DATA_PATH> --num-cluster <NUM_CLUSTER>

Options:
  -d, --data-path <DATA_PATH>      Path to the csv file
  -n, --num-cluster <NUM_CLUSTER>  Number of clusters
  -k, --kpp                        Use Kmeans++ to initialize centers
  -m, --max-iter <MAX_ITER>        Maximum number of iterations [default: 1000]
  -t, --tolerance <TOLERANCE>      Maximum center change tolerance [default: 1e-4]
  -o, --output-path <OUTPUT_PATH>  Path to save indices as csv [default: indices.csv]
  -h, --help                       Print help
  -V, --version                    Print version

About

A simple rust implementation of KMeans Algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages