Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
examples::k_means Namespace Reference

Classes

struct  CentroidAccumulated
 A point which contains "count" accumulated vectors. More...
 
struct  ClosestCentroid
 Assignment of a point to a cluster, which is the input to. More...
 
class  KMeansModel
 Model returned by KMeans algorithm containing results. More...
 

Typedefs

template<size_t D>
using Point = thrill::common::Vector< D, double >
 Compile-Time Fixed-Dimensional Points. More...
 
template<typename Point >
using PointClusterId = std::pair< Point, size_t >
 
using VPoint = thrill::common::VVector< double >
 A variable D-dimensional point with double precision. More...
 

Functions

template<typename Point , typename InStack >
auto KMeans (const DIA< Point, InStack > &input_points, size_t dimensions, size_t num_clusters, size_t iterations)
 

Typedef Documentation

using PointClusterId = std::pair<Point, size_t>

Definition at line 45 of file k-means.hpp.

A variable D-dimensional point with double precision.

Definition at line 42 of file k-means.hpp.

Function Documentation

auto examples::k_means::KMeans ( const DIA< Point, InStack > &  input_points,
size_t  dimensions,
size_t  num_clusters,
size_t  iterations 
)

Calculate k-Means using Lloyd's Algorithm. The DIA centroids is both an input and an output parameter. The method returns a std::pair<Point2D, size_t> = Point2DClusterId into the centroids for each input point.

Definition at line 175 of file k-means.hpp.

References ClosestCentroid< Point >::center, ClosestCentroid< Point >::cluster_id, and Vector< D, Type >::DistanceSquare().

Referenced by RunKMeansFile(), and RunKMeansGenerated().