% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ensemble-graph.r
\name{EHC}
\alias{EHC}
\title{Ensemble hierarchical clustering via graph partitioning (METIS / MST)}
\usage{
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
)
}
\arguments{
\item{List}{A list of data matrices. It is assumed the rows are corresponding with the objects.}

\item{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".}

\item{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").}

\item{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 \code{Normalization}.}

\item{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.}

\item{clust}{Choice of clustering function (character). Defaults to "agnes".}

\item{linkage}{Choice of inter group dissimilarity (character) for each data set. Defaults to c("flexible", "flexible") for two data sets.}

\item{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".}

\item{gap}{Logical. Whether the optimal number of clusters should be determined with the gap statistic. Default is FALSE.}

\item{maxK}{The maximal number of clusters to investigate in the gap statistic. Default is 15.}

\item{graphPartitioning}{A character string indicating the graph partitioning strategy. One of "METIS" (external executable) or "MST" (pure R, requires igraph). Defaults to "METIS".}

\item{optimalk}{An estimate of the final optimal number of clusters. Default is 7.}

\item{waitingtime}{The maximum number of seconds to wait for the external program to write its result before stopping. Defaults to 300.}

\item{file_number}{An identifier appended to the temporary files exchanged with the external program. Defaults to 00.}

\item{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.}
}
\value{
The returned value is a list of two elements:
\item{DistM}{The weighted cluster association matrix}
\item{Clust}{The resulting clustering}
The value has class 'Ensemble'.
}
\description{
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 \code{graphPartitioning}:
\describe{
\item{"METIS"}{Delegates the partitioning of the association graph to an
\strong{external graph-partitioning executable} (METIS / \code{gpmetis} /
\code{shmetis}, or the corresponding MATLAB \code{hmetis} routine). These
binaries are \strong{not bundled} with the package and must be configured
through the \code{executable} argument. When \code{executable=FALSE}
(the default), or when the configured executable cannot be located, the
function stops with an informative error.}
\item{"MST"}{A pure-R minimum spanning tree partitioning that needs no
external executable. It does require the \pkg{igraph} package; if
\pkg{igraph} is not installed the function stops with an informative
error.}
}
}
\examples{
\dontrun{
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")
}
}
\references{
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.
}
