20 using Point = std::vector<int>;
21 std::vector<Point> points {{ 0, 0 }, { 0, 3 } , { 4, 0 }};
22 std::vector<std::vector<Point>> clusters = {
23 { { 0, 0 }, { 0, 3 } }, { { 4, 0 } }
25 std::vector<Point> centers(clusters.size());
26 std::vector<std::pair<Point, int>> point_cluster_pair;
31 paal::k_means(points, centers, std::back_inserter(point_cluster_pair));
int main()
[K Means Clustering Engine Example]
auto k_means(Points &&points, Centers &¢ers, OutputIterator result, Visitor visitor=Visitor{})
this is solve k_means_clustering problem and return vector of cluster example:
void centroids_minimalize_w_c_s_s(Clusters &&clusters, OutputIterator out)
centroid minimize within cluster sum of squares
This file contains set of simple useful functors or functor adapters.