Skip to contents

Setup UMAP config.

Usage

setup_UMAP(
  k = 2L,
  n_neighbors = 15L,
  init = "spectral",
  metric = "euclidean",
  n_epochs = NULL,
  learning_rate = 1,
  scale = TRUE,
  features = NULL
)

Arguments

k

Integer [1, Inf): Number of components.

n_neighbors

Integer [1, Inf): Number of neighbors.

init

Character: Initialization type. See uwot::umap "init".

metric

Character {"euclidean", "cosine", "manhattan", "hamming", "categorical"}: Distance metric.

n_epochs

Optional Integer [1, Inf): Number of epochs.

learning_rate

Numeric [0, Inf): Learning rate.

scale

Logical: If TRUE, scale input data before doing UMAP.

features

Optional Character vector: Names of at least 2 distinct feature columns to decompose. NULL decomposes all numeric features.

Value

UMAPConfig object.

Details

A high n_neighbors value may give error in some systems: "Error in irlba::irlba(L, nv = n, nu = 0, maxit = iters) : function 'as_cholmod_sparse' not provided by package 'Matrix'"

Author

EDG

Examples

umap_config <- setup_UMAP(k = 3L)
umap_config
#> <UMAP DecompositionConfig>
#>             k: <int> 3
#>   n_neighbors: <int> 15
#>          init: <chr> spectral
#>        metric: <chr> euclidean
#>      n_epochs: <NUL> NULL
#> learning_rate: <nmr> 1.00
#>         scale: <lgc> TRUE