clustra_sil {clustra} | R Documentation |
clustra_sil: Prepare silhouette plot data for several k or for a previous clustra run
Description
Performs clustra
runs for several k and prepares silhouette
plot data. Computes a proxy silhouette index based on distances to cluster
centers rather than trajectory pairs. The cost is essentially that of
running clustra for several k as this information is available directly from
clustra. Can also reuse a previous clustra run and produce data for a single
silhouette plot.
Usage
clustra_sil(
data,
kv = NULL,
starts = "random",
mccores = 1,
maxdf = 30,
conv = c(10, 0),
save = FALSE,
verbose = FALSE
)
Arguments
data |
A data.frame (see the |
kv |
Vector of |
starts |
See |
mccores |
See |
maxdf |
Fitting parameters. See |
conv |
Fitting parameters. See |
save |
Logical. When TRUE, save all results as file |
verbose |
Logical. When TRUE, information about each run of clustra is printed. |
Details
When given the raw data as the first parameter (input data
parameter of
trajectories
), kv
specifies a vector of k
parameters for
clustra
and produces data for silhouette plots of each of them.
Alternatively, the input can be the output from a single clustra
run, in
which case data for a single silhouette plot will be made without running
clustra
.
Value
Invisibly returns a list of length length(kv)
, where each element is
a matrix with nrow(data)
rows and three columns cluster
, neighbor
,
silhouette
. The matrix in each element of this list can be used to draw a
silhouette plot. When the input was a completed clustra
run, the output is a
list with a single element for a single silhouette plot.