OpenANN
1.1.0
An open source library for artificial neural networks.
|
K-means clustering. More...
#include <KMeans.h>
Public Member Functions | |
KMeans (int D, int K) | |
Create KMeans object. More... | |
virtual Transformer & | fit (const Eigen::MatrixXd &X) |
Fit transformation according to training set X. More... | |
virtual Eigen::MatrixXd | transform (const Eigen::MatrixXd &X) |
Transform the data. More... | |
Eigen::MatrixXd | operator() (const Eigen::MatrixXd &X) |
Compute for each instance the distances to the centers. More... | |
Eigen::MatrixXd | getCenters () |
Get the learned centers. More... | |
Public Member Functions inherited from OpenANN::Transformer | |
virtual | ~Transformer () |
virtual Transformer & | fitPartial (const Eigen::MatrixXd &X) |
Fit transformation according to subset of the training set X. More... | |
K-means clustering.
This is an iterative implementation based on mini-batch stochastic gradient descent [1].
[1] Sculley, D.: Web-scale k-means clustering, Proceedings of the 19th international conference on World wide web, pp. 1177-1178, ISBN 978-1-60558-799-8, 2010.
OpenANN::KMeans::KMeans | ( | int | D, |
int | K | ||
) |
Create KMeans object.
D | number of features |
K | number of centers |
|
virtual |
Fit transformation according to training set X.
X | each row represents an instance |
Implements OpenANN::Transformer.
Eigen::MatrixXd OpenANN::KMeans::getCenters | ( | ) |
Get the learned centers.
Eigen::MatrixXd OpenANN::KMeans::operator() | ( | const Eigen::MatrixXd & | X) |
Compute for each instance the distances to the centers.
This is an alias for transform().
X | each row represents an instance |
|
inlinevirtual |
Transform the data.
X | each row represents an instance |
Implements OpenANN::Transformer.