bootFlexclust: Bootstrap Flexclust Algorithms

Description Usage Arguments Details Author(s) See Also Examples

View source: R/bootstrap.R

Description

Runs clustering algorithms repeatedly for different numbers of clusters on bootstrap replica of the original data and returns corresponding cluster assignments, centroids and Rand indices comparing pairs of partitions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bootFlexclust(x, k, nboot=100, correct=TRUE, seed=NULL,
              multicore=TRUE, verbose=FALSE, ...)

## S4 method for signature 'bootFlexclust'
summary(object)
## S4 method for signature 'bootFlexclust,missing'
plot(x, y, ...)
## S4 method for signature 'bootFlexclust'
boxplot(x, ...)
## S4 method for signature 'bootFlexclust'
densityplot(x, data, ...)

Arguments

x, k, ...

Passed to stepFlexclust.

nboot

Number of bootstrap pairs of partitions.

correct

Logical, correct the index for agreement by chance?

seed

If not NULL, a call to set.seed() is made before any clustering is done.

multicore

If TRUE, use package parallel for parallel processing. In addition, it may be a workstation cluster object as returned by makeCluster, see examples below.

verbose

If TRUE, show progress information during computations. Will not work with multicore=TRUE.

y, data

Not used.

object

An object of class "bootFlexclust".

Details

Availability of multicore is checked when flexclust is loaded. This information is stored and can be obtained using getOption("flexclust")$have_multicore. Set to FALSE for debugging and more sensible error messages in case something goes wrong.

Author(s)

Friedrich Leisch

See Also

stepFlexclust

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 

## data uniform on unit square
x <- matrix(runif(400), ncol=2)

cl <- FALSE

## to run bootstrap replications on a workstation cluster do the following:
library("parallel")
cl <- makeCluster(2, type = "PSOCK")
clusterCall(cl, function() require("flexclust"))


## 50 bootstrap replicates for speed in example,
## use more for real applications
bcl <- bootFlexclust(x, k=2:7, nboot=50, FUN=cclust, multicore=cl)

bcl
summary(bcl)

## splitting the square into four quadrants should be the most stable
## solution (increase nboot if not)
plot(bcl)
densityplot(bcl, from=0)

## End(Not run)

flexclust documentation built on May 2, 2019, 10:59 a.m.