K-Means Clustering.
More...
#include <kmeans.h>
|
| KMeans (QString distance=QString("sqeuclidean"), QString start=QString("sample"), qint32 replicates=1, QString emptyact=QString("error"), bool online=true, qint32 maxit=100) |
|
bool | calculate (Eigen::MatrixXd X, qint32 kClusters, Eigen::VectorXi &idx, Eigen::MatrixXd &C, Eigen::VectorXd &sumD, Eigen::MatrixXd &D) |
|
K-Means Clustering.
K-Means Clustering
Definition at line 72 of file kmeans.h.
◆ ConstSPtr
◆ SPtr
◆ KMeans()
KMeans::KMeans |
( |
QString |
distance = QString("sqeuclidean") , |
|
|
QString |
start = QString("sample") , |
|
|
qint32 |
replicates = 1 , |
|
|
QString |
emptyact = QString("error") , |
|
|
bool |
online = true , |
|
|
qint32 |
maxit = 100 |
|
) |
| |
|
explicit |
Constructs a KMeans algorithm object.
- Parameters
-
[in] | distance | (optional) K-Means distance measure: "sqeuclidean" (default), "cityblock" , "cosine", "correlation", "hamming". |
[in] | start | (optional) Cluster initialization: "sample" (default), "uniform", "cluster". |
[in] | replicates | (optional) Number of K-Means replicates, which are generated. Best is returned. |
[in] | emptyact | (optional) What happens if a cluster wents empty: "error" (default), "drop", "singleton". |
[in] | online | (optional) If centroids should be updated during iterations: true (default), false. |
[in] | maxit | (optional) maximal number of iterations per replicate; 100 by default. |
Definition at line 66 of file kmeans.cpp.
◆ calculate()
bool KMeans::calculate |
( |
Eigen::MatrixXd |
X, |
|
|
qint32 |
kClusters, |
|
|
Eigen::VectorXi & |
idx, |
|
|
Eigen::MatrixXd & |
C, |
|
|
Eigen::VectorXd & |
sumD, |
|
|
Eigen::MatrixXd & |
D |
|
) |
| |
Clusters input data X
- Parameters
-
[in] | X | Input data (rows = points; cols = p dimensional space). |
[in] | kClusters | Number of k clusters. |
[out] | idx | The cluster indeces to which cluster the input points belong to. |
[out] | C | Cluster centroids k x p. |
[out] | sumD | Summation of the distances to the centroid within one cluster. |
[out] | D | Cluster distances to the centroid. |
Definition at line 120 of file kmeans.cpp.
The documentation for this class was generated from the following files: