Learn R Programming

kmed (version 0.0.1)

clustboot: A Bootstrap replications for clustering alorithm

Description

This function do bootstrap replications for a cluster algorithm.

Usage

clustboot(distdata, nclust = 2, algorithm, nboot = 25, diss = TRUE)

Arguments

distdata

A matrix of distance objects (n x n) or a diss class.

nclust

The number of clusters

algorithm

Any clustering algorithm function with the end result being only membership.

nboot

The number of bootstrap replicates

diss

A logical if the distdata is a dist or matrix object.

Value

Function returns a bootstrap cluster matrix (n x number of bootstrap replicates).

Details

This is a function to obtain bootstrap evaluation for a cluster. The cluster matrix can be further analyzed. In the algorithm function, the input arguments are only a distance/ matrix and a number of cluster.The output is only the membership.

Examples

Run this code
# NOT RUN {
num <- as.matrix(iris[,1:4])
mrwdist <- distNumeric(num, num, method = "mrw")
parkboot <- function(x, nclust) {
res <- fastkmed(x, nclust, iterate = 50)
return(res$cluster)
}
irisboot <- clustboot(mrwdist, nclust=3, parkboot, nboot=7)
head(irisboot)


# }

Run the code above in your browser using DataLab