Package 'lmds'

Title: Landmark Multi-Dimensional Scaling
Description: A fast dimensionality reduction method scaleable to large numbers of samples. Landmark Multi-Dimensional Scaling (LMDS) is an extension of classical Torgerson MDS, but rather than calculating a complete distance matrix between all pairs of samples, only the distances between a set of landmarks and the samples are calculated.
Authors: Robrecht Cannoodt [aut, cre] (<https://orcid.org/0000-0003-3641-729X>, rcannood), Wouter Saelens [aut] (<https://orcid.org/0000-0002-7114-6248>, zouter)
Maintainer: Robrecht Cannoodt <[email protected]>
License: GPL-3
Version: 0.1.1
Built: 2024-11-15 03:05:26 UTC
Source: https://github.com/dynverse/lmds

Help Index


Landmark Multi-Dimensional Scalng

Description

A fast dimensionality reduction method scaleable to large numbers of samples. Landmark Multi-Dimensional Scaling (LMDS) is an extension of classical Torgerson MDS, but rather than calculating a complete distance matrix between all pairs of samples, only the distances between a set of landmarks and the samples are calculated.

Author(s)

Maintainer: Robrecht Cannoodt [email protected] (ORCID) (rcannood)

Authors:

See Also

Useful links:


Perform MDS on landmarks and project other samples to the same space

Description

Perform MDS on landmarks and project other samples to the same space

Usage

cmdscale_landmarks(dist_2lm, ndim = 3, rescale = TRUE, ...)

Arguments

dist_2lm

Distance matrix between the landmarks and all the samples in original dataset

ndim

The number of dimensions

rescale

Whether or not to rescale the final dimensionality reduction (recommended)

...

Extra params to pass to irlba::irlba()

Value

The dimensionality reduction in the form of a ncol(dist_2lm) by ndim matrix.

Examples

library(Matrix)
x <- as.matrix(iris[,1:4])
dist_2lm <- select_landmarks(x)
cmdscale_landmarks(dist_2lm)

Landmark MDS

Description

A fast dimensionality reduction method scaleable to large numbers of samples. Landmark Multi-Dimensional Scaling (LMDS) is an extension of classical 'Torgerson MDS', but rather than calculating a complete distance matrix between all pairs of samples, only the distances between a set of landmarks and the samples are calculated.

Usage

lmds(
  x,
  ndim = 3,
  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.

ndim

The number of dimensions

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 dimensionality reduction in the form of a nrow(x) by ndim matrix.

Examples

library(Matrix)
x <- Matrix::rsparsematrix(1000, 1000, .01)
lmds(x, ndim = 3)

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)