fitGrid {scPCA}R Documentation

Identify the Optimal Contrastive and Penalty Parameters

Description

This function is used to automatically select the optimal contrastive parameter and L1 penalty term for scPCA based on a clustering algorithm and average silhouette width.

Usage

fitGrid(target, target_valid = NULL, center, scale, c_contrasts,
  contrasts, penalties, n_eigen, clust_method = c("kmeans", "pam"),
  n_centers, max_iter = 10)

Arguments

target

The target (experimental) data set, in a standard format such as a data.frame or matrix.

target_valid

A holdout set of the target (experimental) data set, in a standard format such as a data.frame or matrix. NULL by default but used by cvSelectParams for cross-validated selection of the contrastive and penalization parameters.

center

A logical indicating whether the target and background data sets should be centered to mean zero.

scale

A logical indicating whether the target and background data sets should be scaled to unit variance.

c_contrasts

A list of contrastive covariances.

contrasts

A numeric vector of the contrastive parameters used to compute the contrastive covariances.

penalties

A numeric vector of the penalty terms.

n_eigen

A numeric indicating the number of eigenvectors to be computed.

clust_method

A character specifying the clustering method to use for choosing the optimal constrastive parameter. Currently, this is limited to either k-means or partitioning around medoids (PAM). The default is k-means clustering.

n_centers

A numeric giving the number of centers to use in the clustering algorithm.

max_iter

A numeric giving the maximum number of iterations to be used in k-means clustering, defaulting to 10.

Value

A list similar to that output by prcomp:


[Package scPCA version 1.0.0 Index]