Macros | |
#define | DBL_MAXIMUM 1.e30 |
#define | DATA(iech, ivar) (data[(iech) * nvar + (ivar)]) |
#define | DATA1(iech, ivar) (data1[(iech) * nvar + (ivar)]) |
#define | DATA2(iech, ivar) (data2[(iech) * nvar + (ivar)]) |
#define | CDATA(icl, ivar) (cdata[(icl) * nvar + (ivar)]) |
#define | DISTMATRIX(i, j) (distmatrix[(i) * nech + (j)]) |
Functions | |
static double | st_distance (int nvar, const double *data1, const double *data2, int index1, int index2) |
static void | st_randomassign (int nclusters, int nech, int *clusterid) |
static void | st_printclusterlist (int nclusters, int nech, int *clusterid) |
static void | st_printclustercount (int nclusters, int nech, const int *clusterid) |
static void | st_getclustermeans (const double *data, int nvar, int nech, int nclusters, const int *clusterid, double *cdata, int *cmask) |
static void | st_getclustermedian (const double *data, int nvar, int nech, int nclusters, const int *clusterid, double *cdata, double *cache) |
static double * | st_get_distmatrix (double *data, int nvar, int nech) |
static void | st_getclustermedoids (int nech, int nclusters, const double *distmatrix, const int *clusterid, int *centroids, double *errors) |
double * | kclusters (double *data, int nvar, int nech, int nclusters, int npass, int mode, int verbose) |
int * | kmedoids (double *data, int nvar, int nech, int nclusters, int npass, int verbose) |
#define CDATA | ( | icl, | |
ivar | |||
) | (cdata[(icl) * nvar + (ivar)]) |
#define DATA | ( | iech, | |
ivar | |||
) | (data[(iech) * nvar + (ivar)]) |
#define DATA1 | ( | iech, | |
ivar | |||
) | (data1[(iech) * nvar + (ivar)]) |
#define DATA2 | ( | iech, | |
ivar | |||
) | (data2[(iech) * nvar + (ivar)]) |
#define DBL_MAXIMUM 1.e30 |
#define DISTMATRIX | ( | i, | |
j | |||
) | (distmatrix[(i) * nech + (j)]) |
double* kclusters | ( | double * | data, |
int | nvar, | ||
int | nech, | ||
int | nclusters, | ||
int | npass, | ||
int | mode, | ||
int | verbose | ||
) |
Perform k-means clustering on a given set of variables. The number of clusters is given in input
[in] | data | Array of values |
[in] | nvar | Number of samples |
[in] | nech | Number of variables |
[in] | nclusters | Number if clusters |
[in] | npass | Number of times clustering is performed |
[in] | mode | 0 for k-means and 1 for k-medians |
[in] | verbose | Verbose option |
int* kmedoids | ( | double * | data, |
int | nvar, | ||
int | nech, | ||
int | nclusters, | ||
int | npass, | ||
int | verbose | ||
) |
Perform k-medoids clustering on a given set of variables. The number of clusters is given in input
[in] | data | Array of values |
[in] | nvar | Number of samples |
[in] | nech | Number of variables |
[in] | nclusters | Number if clusters |
[in] | npass | Number of times clustering is performed |
[in] | verbose | Verbose option |
|
static |
|
static |
Evaluate the distance matrix
[in] | data | Array of values |
[in] | nvar | Number of samples |
[in] | nech | Number of variables |
|
static |
Find the center of a cluster
|
static |
|
static |
|
static |
Print the number of samples per cluster
[in] | nclusters | Number if clusters |
[in] | nech | Number of samples |
[in] | clusterid | Array of cluster number for each sample |
|
static |
Print the list of cluster per sample
[in] | nclusters | Number if clusters |
[in] | nech | Number of samples |
[in] | clusterid | Array of cluster number for each sample |
|
static |
Initial random assignment of samples to clusters
[in] | nclusters | Number if clusters |
[in] | nech | Number of samples |
[out] | clusterid | Array of cluster number for each sample |