CheckInputClustering: Checking input parameters (clustering)

View source: R/check.R

CheckInputClusteringR Documentation

Checking input parameters (clustering)

Description

Checks if input parameters are valid. For invalid parameters, this function (i) stops the run and generates an error message, or (ii) sets the invalid parameter to its default value and reports it in a warning message.

Usage

CheckInputClustering(
  xdata,
  Lambda = NULL,
  pi_list = seq(0.6, 0.9, by = 0.01),
  K = 100,
  tau = 0.5,
  seed = 1,
  n_cat = 3,
  implementation = HierarchicalClustering,
  scale = TRUE,
  resampling = "subsampling",
  verbose = TRUE
)

Arguments

xdata

data matrix with observations as rows and variables as columns.

Lambda

vector of penalty parameters for weighted distance calculation. Only used for distance-based clustering, including for example implementation=HierarchicalClustering, implementation=PAMClustering, or implementation=DBSCANClustering.

K

number of resampling iterations.

tau

subsample size.

seed

value of the seed to initialise the random number generator and ensure reproducibility of the results (see set.seed).

n_cat

computation options for the stability score. Default is NULL to use the score based on a z test. Other possible values are 2 or 3 to use the score based on the negative log-likelihood.

implementation

function to use for clustering. Possible functions include HierarchicalClustering (hierarchical clustering), PAMClustering (Partitioning Around Medoids), KMeansClustering (k-means) and GMMClustering (Gaussian Mixture Models). Alternatively, a user-defined function taking xdata and Lambda as arguments and returning a binary and symmetric matrix for which diagonal elements are equal to zero can be used.

scale

logical indicating if the data should be scaled to ensure that all variables contribute equally to the clustering of the observations.

verbose

logical indicating if a loading bar and messages should be printed.


sharp documentation built on April 11, 2025, 5:44 p.m.