View source: R/ensemble-graph.r
| EHC | R Documentation |
Ensemble Hierarchical Clustering (EHC) builds a cluster association graph from the agglomerative clustering results of each data source. Strengths of association between pairs of objects are accumulated across the dendrograms (weighted by cluster depth and intra-cluster proximity), yielding a weighted adjacency matrix that is then partitioned.
Two partitioning strategies are available through graphPartitioning:
Delegates the partitioning of the association graph to an
external graph-partitioning executable (METIS / gpmetis /
shmetis, or the corresponding MATLAB hmetis routine). These
binaries are not bundled with the package and must be configured
through the executable argument. When executable=FALSE
(the default), or when the configured executable cannot be located, the
function stops with an informative error.
A pure-R minimum spanning tree partitioning that needs no external executable. It does require the igraph package; if igraph is not installed the function stops with an informative error.
EHC(
List,
type = c("data", "dist", "clust"),
distmeasure = c("tanimoto", "tanimoto"),
normalize = c(FALSE, FALSE),
method = c(NULL, NULL),
clust = "agnes",
linkage = c("flexible", "flexible"),
alpha = 0.625,
gap = FALSE,
maxK = 15,
graphPartitioning = c("METIS", "MST"),
optimalk = 7,
waitingtime = 300,
file_number = 0,
executable = FALSE
)
List |
A list of data matrices. It is assumed the rows are corresponding with the objects. |
type |
indicates whether the provided matrices in "List" are either data matrices, distance matrices or clustering results obtained from the data. If type="dist" the calculation of the distance matrices is skipped and if type="clust" the single source clustering is skipped. Type should be one of "data", "dist" or "clust". |
distmeasure |
A vector of the distance measures to be used on each data matrix. Should be one of "tanimoto", "euclidean", "jaccard", "hamming". Defaults to c("tanimoto","tanimoto"). |
normalize |
Logical. Indicates whether to normalize the distance matrices or not, defaults to c(FALSE, FALSE) for two data sets. This is recommended if different distance types are used. More details on normalization in |
method |
A method of normalization. Should be one of "Quantile","Fisher-Yates", "standardize","Range" or any of the first letters of these names. Default is c(NULL,NULL) for two data sets. |
clust |
Choice of clustering function (character). Defaults to "agnes". |
linkage |
Choice of inter group dissimilarity (character) for each data set. Defaults to c("flexible", "flexible") for two data sets. |
alpha |
The parameter alpha to be used in the "flexible" linkage of the agnes function. Defaults to 0.625 and is only used if the linkage is set to "flexible". |
gap |
Logical. Whether the optimal number of clusters should be determined with the gap statistic. Default is FALSE. |
maxK |
The maximal number of clusters to investigate in the gap statistic. Default is 15. |
graphPartitioning |
A character string indicating the graph partitioning strategy. One of "METIS" (external executable) or "MST" (pure R, requires igraph). Defaults to "METIS". |
optimalk |
An estimate of the final optimal number of clusters. Default is 7. |
waitingtime |
The maximum number of seconds to wait for the external program to write its result before stopping. Defaults to 300. |
file_number |
An identifier appended to the temporary files exchanged with the external program. Defaults to 00. |
executable |
Either FALSE (the default) or the path/flag identifying the external graph-partitioning executable (METIS / gpmetis / shmetis) or MATLAB to use for the "METIS" strategy. When FALSE the "METIS" path stops, since no partition can be computed in pure R. Precompiled binaries are not bundled with the package. |
The returned value is a list of two elements:
DistM |
The weighted cluster association matrix |
Clust |
The resulting clustering |
The value has class 'Ensemble'.
Mirzaei A. and Rahmati M. (2010). A novel hierarchical-clustering-combination scheme based on fuzzy-similarity relations. IEEE Transactions on Fuzzy Systems, 18(1), 27-39.
## Not run:
data(mosaic_toy)
L <- mosaic_toy$List
# METIS path requires an external graph-partitioning executable / MATLAB
# configured through the 'executable' argument.
res <- EHC(List = L, type = "data",
distmeasure = c("euclidean", "euclidean"), normalize = c(FALSE, FALSE),
method = c(NULL, NULL), clust = "agnes",
linkage = c("flexible", "flexible"), alpha = 0.625, gap = FALSE,
maxK = 15, graphPartitioning = "METIS", optimalk = 7,
executable = "./MetisAlgorithm")
# MST path is pure R but needs the igraph package.
res2 <- EHC(List = L, type = "data", graphPartitioning = "MST")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.