extractProtos: Prototypes extraction

Description Usage Arguments Details Value Examples

View source: R/sampleClustering.R

Description

Extract prototypes of each cluster automatically, according to a clustering result, and save them in different directories. In order to catch the whole variability, each cluster is divided into several sub-clusters, and medoids of each sub-cluster are considered as prototypes.

Usage

1
2
3
4
5
6
7
extractProtos(
  data.sample,
  method,
  K.max = 20,
  kmeans.variance.min = 0.95,
  user.name = ""
)

Arguments

data.sample

list containing features, profiles and clustering results.

method

character vector specifying the clustering method (already performed) to use.

K.max

maximal number of clusters (K.max=20 by default).

kmeans.variance.min

elbow method cumulative explained variance > criteria to stop K-search.

user.name

character vector specifying the user name.

Details

extractProtos extracts prototypes automatically according to a clustering result, and save them in different directories

Value

csv file containing the prototypes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dat <- rbind(matrix(rnorm(100, mean = 0, sd = 0.3), ncol = 2), 
             matrix(rnorm(100, mean = 2, sd = 0.3), ncol = 2), 
             matrix(rnorm(100, mean = 4, sd = 0.3), ncol = 2))
tf1 <- tempfile()
write.table(dat, tf1, sep=",", dec=".")

x <- importSample(file.features=tf1, dir.save=tempdir())
x <- computeUnSupervised(x, K=3, method.name="K-means")

extractProtos(x, method = "K-means_preprocessed")

RclusTool documentation built on Feb. 4, 2020, 5:08 p.m.