21 #include "drwnFeatureTransform.h" 24 using namespace Eigen;
60 unsigned _numClusters;
72 const char *
type()
const {
return "drwnKMeans"; }
80 bool save(drwnXMLNode& node)
const;
81 bool load(drwnXMLNode& node);
85 double train(
const vector<vector<double> >& features);
86 double train(
const vector<vector<double> >& features,
const vector<double>& weights);
90 void transform(
const vector<double>& x, vector<double>& y)
const;
Implements k-means clustering. Outputs the squared-distance to each of the cluster centroids...
Definition: drwnKMeans.h:54
static int MAX_ITERATIONS
maximum number of training iterations
Definition: drwnKMeans.h:57
static int DEFAULT_K
default number of clusters
Definition: drwnKMeans.h:56
const char * type() const
returns object type as a string (e.g., Foo::type() { return "Foo"; })
Definition: drwnKMeans.h:72
drwnKMeans * clone() const
returns a copy of the class usually implemented as virtual Foo* clone() { return new Foo(*this); } ...
Definition: drwnKMeans.h:73
const MatrixXd & getCentroids() const
returns the k centroids
Definition: drwnKMeans.h:76