MNE-CPP  0.1.9
A Framework for Electrophysiology
Public Types | Public Member Functions | List of all members
UTILSLIB::KMeans Class Reference

K-Means Clustering. More...

#include <kmeans.h>

Public Types

typedef QSharedPointer< KMeansSPtr
 
typedef QSharedPointer< const KMeansConstSPtr
 

Public Member Functions

 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)
 

Detailed Description

K-Means Clustering.

K-Means Clustering

Definition at line 72 of file kmeans.h.

Member Typedef Documentation

◆ ConstSPtr

typedef QSharedPointer<const KMeans> UTILSLIB::KMeans::ConstSPtr

Const shared pointer type for KMeans.

Definition at line 76 of file kmeans.h.

◆ SPtr

typedef QSharedPointer<KMeans> UTILSLIB::KMeans::SPtr

Shared pointer type for KMeans.

Definition at line 75 of file kmeans.h.

Constructor & Destructor Documentation

◆ 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.

Member Function Documentation

◆ 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]XInput data (rows = points; cols = p dimensional space).
[in]kClustersNumber of k clusters.
[out]idxThe cluster indeces to which cluster the input points belong to.
[out]CCluster centroids k x p.
[out]sumDSummation of the distances to the centroid within one cluster.
[out]DCluster distances to the centroid.

Definition at line 120 of file kmeans.cpp.


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