select_landmarks: Select landmarks from dataset

View source: R/select_landmarks.R

select_landmarksR Documentation

Select landmarks from dataset

Description

In addition, the distances between the landmarks and all samples are calculated.

Usage

select_landmarks(
  x,
  distance_method = c("euclidean", "pearson", "spearman", "cosine", "chisquared",
    "hamming", "kullback", "manhattan", "maximum", "canberra", "minkowski"),
  landmark_method = c("sample"),
  num_landmarks = 500
)

Arguments

x

A matrix, optionally sparse.

distance_method

The distance metric to use. Options are "euclidean" (default), "pearson", "spearman", "cosine", "manhattan".

landmark_method

The landmark selection method to use. Options are "sample" (default).

num_landmarks

The number of landmarks to use,

Value

The distance matrix between the landmarks and all samples. In addition, an attribute "landmark_ix" denotes the indices of landmarks that were sampled.

Examples

library(Matrix)
x <- Matrix::rsparsematrix(1000, 1000, .01)
select_landmarks(x)

dynverse/lmds documentation built on Sept. 25, 2023, 4:39 p.m.