Learn R Programming

microSTASIS (version 0.1.0)

CV_iterative_clustering: Cross validation of the iterative Hartigan-Wong k-means clustering.

Description

Perform cross validation in the way of leave-one-out (LOO) or k-fold of the stability results from iterative_clustering().

Usage

CV_iterative_clustering(data, results, common, k = 1L, parallel = TRUE)

Arguments

data

input matrix with paired times, i.e. samples to be stressed to multiple iterations.

results

the stabilitas() output for the concrete paired times used for validation.

common

pattern that separates the ID and the sampling time.

k

integer; number of individuals to subset from the data for each time running iterative_clustering().

parallel

logical; FALSE to sequentially run the internal loop or TRUE to do it by parallel computing (number of cores = 4).

Value

Multiple lists with multiple objects of class "kmeans".

Examples

Run this code
# NOT RUN {
t1_t2 <- paired_times(data = clr, first = "_1",
                      second = "_25", common = "_0_")
klist_t1_t2 <- iterative_clustering(data = t1_t2, parallel = FALSE)
result_t1_t2 <- stabilitas(klist_t1_t2, common = "_0_")
cv_klist_t1_t2_k2 <- CV_iterative_clustering(data = t1_t2, results = result_t1_t2,
                                             common = "_0_", k = 2L, parallel = FALSE)
# }

Run the code above in your browser using DataLab