View source: R/sampleClustering.R
extractProtos | R Documentation |
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.
extractProtos(
data.sample,
method,
K.max = 20,
kmeans.variance.min = 0.95,
user.name = ""
)
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. |
extractProtos extracts prototypes automatically according to a clustering result, and save them in different directories
csv file containing the prototypes
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=".")
dir.results <- tempdir()
x <- importSample(file.features=tf1, dir.save=dir.results)
x <- computeUnSupervised(x, K=3, method.name="K-means")
extractProtos(x, method = "K-means_preprocessed")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.