This repository contains a C++ implementation of Lloyd's algorithm. The core algorithm is written in C++, while Python is used to call the C++ function and visualize results using pybind11.
Lloyd's algorithm is a iterative method used to perform K-means clustering. Given sets
This optimization problem we would like to solve is very hard. Therefore, we can use Lloyd's algorithm, which iteratively updates cluster assignments and centroids and guarantees convergence to a local optimum of the objective function. We can formulate the objective in terms of cluster centroids as
where
- Install the package:
python3 -m install .- Run the main script:
python3 main.py