nowcluster is a small C clustering library with Python bindings.
import numpy as np
from pynowcluster.clusters import FractalKMeans
n = 1_000_000
x = np.random.normal(0, 10, n)
y = np.random.normal(0, 5, n)
X = np.stack((x,y), axis=1)
X = X.astype(np.float32)
fkm = FractalKMeans().process(X)
print(fkm.clusters)
print(fkm.converged)
- Update the path to vcvarsall.bat inside
win_startup.bat - Run
win_startup.bat - Run
win_build.bat - Move the DLL into the appropriate pynowclusters folder based on target machine (x32/x64) and os (win).
- Run the makefile
makelocated inside the folder "ccore" to create the shared library. - Move the shared library into the appropriate pynowclusters folder based on target machine (x32/x64) and os (linux).