Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/llimllib/ckmeans

ckmeans in python with numpy
https://github.com/llimllib/ckmeans

Last synced: about 1 month ago
JSON representation

ckmeans in python with numpy

Awesome Lists containing this project

README

        

ckmeans
=======

Ckmeans is a function to cluster a one-dimensional array of floats into `k` optimal clusters.
`Optimal` here means that the standard deviation inside each cluster is minimized.

Ckmeans was developed by
[Haizhou Wang and Mingzhou Song](http://journal.r-project.org/archive/2011-2/RJournal_2011-2_Wang+Song.pdf).

This code follows directly from Tom MacWright's code in
[simple-statistics](https://github.com/simple-statistics/simple-statistics/blob/master/src/ckmeans.js)
and David Schnurr's code in [d3-scale-cluster](https://github.com/schnerd/d3-scale-cluster/).

Please use this code in any way you wish, with or without attribution. It's licensed WTFPL.

If you'd rather use the original C++ code via a cython wrapper, check out
[rocketrip/ckmeans](https://github.com/rocketrip/ckmeans).

_2024 update_: I recommend [ckmeans_py](https://github.com/urschrei/ckmeans_py) (available on
[pyPI](https://pypi.org/project/ckmeans/)) which wraps an efficient rust version of this algorithm

In 2022 ckmeans picked up a [citation](https://arxiv.org/ftp/arxiv/papers/2202/2202.04883.pdf)!