Abstract clustering model. More...
#include <Clustering.hpp>

Public Member Functions | |
| virtual | ~Model () |
| Virtual destructor. | |
| virtual bool | fit (Eigen::Ref< const Eigen::MatrixXd > data)=0 |
| Fits the model. More... | |
| virtual unsigned int | number_clusters () const =0 |
| Returns the number of clusters. More... | |
| virtual const std::vector< unsigned int > & | labels () const =0 |
| Returns a const reference to resulting cluster labels for each datapoint. Value make sense only if fitting converged successfully. | |
| virtual const Eigen::MatrixXd & | centroids () const =0 |
| Returns a const reference to the matrix of cluster centroids (in columns). More... | |
| virtual bool | converged () const =0 |
| Reports if the model converged. | |
Abstract clustering model.
|
pure virtual |
Fits the model.
| [in] | data | Matrix (column-major order) with a data point in every column. |
true if fitting converged successfully. | std::invalid_argument | If data has no rows, or if the sample size (number of columns in data) is too low. |
Implemented in ml::EM, and ml::Clustering::KMeans.
|
pure virtual |
Returns the number of clusters.
Value make sense only if fitting converged successfully.
Implemented in ml::EM, and ml::Clustering::KMeans.
|
pure virtual |
Returns a const reference to the matrix of cluster centroids (in columns).
A centroid represent the central location of the cluster. It is e.g. a mean of all points in the cluster. Value make sense only if fitting converged successfully.
Implemented in ml::EM, and ml::Clustering::KMeans.