Skip to content

llimllib/ckmeans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

This code follows directly from Tom MacWright's code in simple-statistics and David Schnurr's code in 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.

2024 update: I recommend ckmeans_py (available on pyPI) which wraps an efficient rust version of this algorithm

In 2022 ckmeans picked up a citation!

About

ckmeans in python with numpy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages