Validates a precomputed km_at_cl object (the output of
KmeansInference::kmeans_inference()) against the data matrix
X, the requested number of clusters NC and the pair of
clusters to compare. Also discards km_at_cl when sample
splitting is requested (since X changes after splitting), checks
that clusters is a valid specification, and reconciles
sample_split with return_X_clus.
Arguments
- km_at_cl
An optional precomputed output of
KmeansInference::kmeans_inference(), orNULL.- X
A numeric \(n \times p\) data matrix.
- NC
Integer scalar giving the number of clusters.
- clusters
Integer vector of length 2 specifying the pair of clusters to compare. Entries must belong to
1:NC.- sample_split
Logical. Whether sample splitting is used to estimate
Sigma.- return_X_clus
Logical. Whether the data matrix used for clustering should be returned.
Value
A named list with:
- km_at_cl
The validated
km_at_cl, orNULLif it was not provided or was discarded becausesample_split = TRUE.- return_X_clus
The (possibly adjusted)
return_X_clusflag.
See also
Other Utilities:
ARI(),
is.CS(),
preserve.cl(),
setup.model(),
test_statistic(),
validate_hc_setting(),
validate_km_candidate(),
validate_ndraws(),
validate_seed()