OpenANN  1.1.0
An open source library for artificial neural networks.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions
OpenANN::KMeans Class Reference

K-means clustering. More...

#include <KMeans.h>

+ Inheritance diagram for OpenANN::KMeans:

Public Member Functions

 KMeans (int D, int K)
 Create KMeans object. More...
 
virtual Transformerfit (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 TransformerfitPartial (const Eigen::MatrixXd &X)
 Fit transformation according to subset of the training set X. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

OpenANN::KMeans::KMeans ( int  D,
int  K 
)

Create KMeans object.

Parameters
Dnumber of features
Knumber of centers

Member Function Documentation

virtual Transformer& OpenANN::KMeans::fit ( const Eigen::MatrixXd &  X)
virtual

Fit transformation according to training set X.

Parameters
Xeach row represents an instance
Returns
this for chaining

Implements OpenANN::Transformer.

Eigen::MatrixXd OpenANN::KMeans::getCenters ( )

Get the learned centers.

Returns
each row represents a center
Eigen::MatrixXd OpenANN::KMeans::operator() ( const Eigen::MatrixXd &  X)

Compute for each instance the distances to the centers.

This is an alias for transform().

Parameters
Xeach row represents an instance
Returns
each row contains the distances to all centers
virtual Eigen::MatrixXd OpenANN::KMeans::transform ( const Eigen::MatrixXd &  X)
inlinevirtual

Transform the data.

Parameters
Xeach row represents an instance
Returns
transformed data

Implements OpenANN::Transformer.


The documentation for this class was generated from the following file: