Register user-defined partition functions
a named list of functions.
normally, data matrix are scaled by rows before sent to the partition function. The default scaling is applied by
The user-defined function should accept at least two arguments. The first two arguments are the data
matrix and the number of partitions. The third optional argument should always be
... so that parameters
for the partition function can be passed by
If users forget to add
... in the end, it is added internally.
The function should return a vector of partitions (or class labels) or an object which can be recognized by
The partition function should be applied on columns (Users should be careful with this because some of the R functions apply on rows and some of the R functions apply on columns). E.g. following is how we register kmeans partition method:
1 2 3 4 5
The registered partition methods will be used as defaults in
To remove a partition method, use
There are following default partition methods:
hierarchcial clustering with Euclidean distance, later columns are partitioned by
cutree. If users want to use another distance metric, consider to register a new partition method. E.g.
register_partition_method(hclust_cor = function(mat, k) hc = cutree(hclust(as.dist(cor(mat))))).
Mclust. mclust is applied to the first three principle components from rows.
No value is returned.
Zuguang Gu <[email protected]>
all_partition_methods lists all registered partition methods.
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.