Skip to contents

project_landmark_model() computes query-to-reference KNN with the same native backend policy used by the full embedding functions, then applies the method-specific fixed-reference transform. Landmark coordinates remain fixed.

Usage

project_landmark_model(
  model,
  data,
  query_indices = NULL,
  transform_k = NULL,
  refinement_epochs = 50L,
  transform_perplexity = 5,
  transform_iter = 250L,
  transform_early_exaggeration_iter = 0L,
  transform_n_negatives = NULL,
  initialization = c("median", "weighted", "random"),
  keep_knn = FALSE,
  n.cores = NULL,
  verbose = FALSE,
  ...
)

Arguments

model

The model element returned by umap() or tsne() when landmarking is enabled.

data

New query observations in the original feature space used for fitting. The stored standardization and PCA transforms are applied before query-to-reference search.

query_indices

Optional rows of data to project. To reconstruct the original training layout explicitly, pass the original matrix and model$selection$query_indices. With NULL, every supplied row is treated as a genuinely new query, even when its row count matches the training set.

transform_k

Number of reference neighbors.

refinement_epochs

Fixed-reference UMAP refinement epochs.

transform_perplexity

Perplexity of the t-SNE transform.

transform_iter

Number of t-SNE transform iterations.

transform_early_exaggeration_iter

Transform exaggeration iterations.

transform_n_negatives

Number of reference negatives for t-SNE.

initialization

t-SNE query initialization.

keep_knn

Retain query-to-reference KNN output.

n.cores

Number of CPU cores.

verbose

Print optimizer progress.

...

Low-level t-SNE transform controls.

Value

A fastEmbedR_embedding. Explicit original-query indices reassemble layout in training row order; otherwise it contains only query rows. The returned parameters record projection_scope as "original_reconstruction" or "held_out_query".

Examples

x <- scale(as.matrix(iris[, 1:4]))
fit <- umap(x, n_neighbors = 10, landmarks = 0.5, seed = 1)
query <- x[1:3, , drop = FALSE]
projected <- project_landmark_model(
    fit$model, query, transform_k = 10, refinement_epochs = 0
)