x
using the bagged clustering
algorithm. A partitioning cluster algorithm such as
kmeans
is run repeatedly on bootstrap samples from the
original data. The resulting cluster centers are then combined using
the hierarchical cluster algorithm hclust
.
bclust(x, centers=2, iter.base=10, minsize=0, dist.method="euclidian", hclust.method="average", base.method="kmeans", base.centers=20, verbose=TRUE, final.kmeans=FALSE, docmdscale=FALSE, resample=TRUE, weights=NULL, maxcluster=base.centers, ...)
hclust.bclust(object, x, centers, dist.method=object$dist.method, hclust.method=object$hclust.method, final.kmeans=FALSE, docmdscale = FALSE, maxcluster=object$maxcluster)
"plot"(x, maxcluster=x$maxcluster, main, ...)
centers.bclust(object, k)
clusters.bclust(object, k, x=NULL)
"bclust"
for plot).dist
for available distances.hclust
for available methods.TRUE
, a final kmeans step is performed
using the output of the bagged clustering as initialization.TRUE
a cmdscale
result is included in the return value.TRUE
the base method is run on
bootstrap samples of x
, else directly on x
.nrow(x)
, weights for the
resampling. By default all observations have equal weight."bclust"
.bclust
, ignored in plot
.bclust
and hclust.bclust
return objects of class
"bclust"
including the components
"hclust"
).iter.base * base.centers
centers found in the base runs.iter.base
bootstrap samples of the original data in
x
are created by drawing with replacement. The base cluster
method is run on each of these samples with base.centers
centers. The base.method
must be the name of a partitioning
cluster function returning a list with the same components as the
return value of kmeans
. This results in a collection of iter.base *
base.centers
centers, which are subsequently clustered using
the hierarchical method hclust
. Base centers with less
than minsize
points in there respective partitions are removed
before the hierarchical clustering.
The resulting dendrogram is then cut to produce centers
clusters. Hence, the name of the argument centers
is a little
bit misleading as the resulting clusters need not be convex, e.g.,
when single linkage is used. The name was chosen for compatibility
with standard partitioning cluster methods such as
kmeans
.
A new hierarchical clustering (e.g., using another
hclust.method
) re-using previous base runs can be
performed by running hclust.bclust
on the return value of
bclust
.
hclust
, kmeans
,
boxplot.bclust
data(iris)
bc1 <- bclust(iris[,1:4], 3, base.centers=5)
plot(bc1)
table(clusters.bclust(bc1, 3))
centers.bclust(bc1, 3)
Run the code above in your browser using DataLab