ECOCPAK v0.9
Functions
Fn_kmeans

Functions

template<typename T1 >
void ecocpak::kmeans (Col< u32 > &indices_out, Col< u32 > &ranks_out, Mat< typename T1::elem_type > &centroids_out, const Base< typename T1::elem_type, T1 > &X, const u32 k, const typename T1::pod_type lr=0.01)
mat ecocpak::subClasses (ucolvec &inds, ucolvec &ranks, const mat &samples)

Function Documentation

template<typename T1 >
void ecocpak::kmeans ( Col< u32 > &  indices_out,
Col< u32 > &  ranks_out,
Mat< typename T1::elem_type > &  centroids_out,
const Base< typename T1::elem_type, T1 > &  X,
const u32  k,
const typename T1::pod_type  lr = 0.01 
) [inline]
  • K-means clustering.
  • Input Arguments:
    • X : Base object which includes the samples' matrix
    • k : k denotes the number of desired clusters.
    • lr : Starting learning rate for online phase version of K-means (default 1%).
  • Output Arguments:
    • indices_out : Cluster indices for each point.
    • ranks_out : Vector which holds the number of samples that correspond to each centroid.
    • centroids_out : Cluster centroid locations.
  • Return Argument:
    • Void.
mat ecocpak::subClasses ( ucolvec &  inds,
ucolvec &  ranks,
const mat &  samples 
)
  • Function subClasses splits a data set in two subclasses using K-means clustering.
  • Input Arguments:
    • inds : Sample cluster indices.
    • ranks : A vector which its position denotes the number of samples in each cluster.
    • samples : Sample vectors' matrix.
  • Output Arguments:
    • Void.
  • Return Argument:
    • A matrix which represents the centers of clusters.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerator Defines