View source: R/120_ClusteringConfig.R
| setup_PAMK | R Documentation |
Setup a PAMKConfig object for Partitioning Around Medoids with estimation
of the number of clusters (PAMK), via the 'fpc' package.
setup_PAMK(
krange = 2:10,
criterion = setup_ASWCriterion(),
use_pam = TRUE,
scaling = FALSE,
alpha = 0.001,
features = NULL
)
krange |
Integer [1, Inf) vector: Candidate numbers of clusters to compare. Must include at least one value greater than 1. |
criterion |
|
use_pam |
Logical: If TRUE, fit each candidate with PAM; if FALSE, with CLARA. |
scaling |
Logical: If TRUE, scale each variable by its root mean square after centering. |
alpha |
Numeric [0, 1]: Significance level of the Duda-Hart test, used only when 1 is among the candidates. |
features |
Optional Character vector: Names of at least 2 distinct
feature columns to cluster on. |
PAMK fits PAM (or CLARA) for every candidate in krange and keeps the one
scoring best under criterion. There is therefore no k to set, and the
number of clusters chosen is reported by the resulting Clustering.
Argument names are rtemis' own. They map to fpc::pamk() as:
use_pam -> usepam; the criterion's type -> criterion and its
n_subsets -> ns; the rest keep their names.
fpc::pamk() also accepts a per-variable numeric vector for scaling; only
the logical form is exposed here. Scale by column with preprocess instead,
where the decision is recorded and replayed with the data.
PAMKConfig object.
EDG
Kaufman L, Rousseeuw PJ (1990). Finding Groups in Data: An Introduction to Cluster Analysis. Wiley. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/9780470316801")}
pamk_config <- setup_PAMK(krange = 2:5)
pamk_config
setup_PAMK(krange = 2:5, criterion = setup_MultiASWCriterion(n_subsets = 20L))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.