Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

DiffusionMaps-class

Diffusion Maps


Description

An S4 Class implementing Diffusion Maps

Details

Diffusion Maps uses a diffusion probability matrix to robustly approximate a manifold.

Slots

fun

A function that does the embedding and returns a dimRedResult object.

stdpars

The standard parameters for the function.

General usage

Dimensionality reduction methods are S4 Classes that either be used directly, in which case they have to be initialized and a full list with parameters has to be handed to the @fun() slot, or the method name be passed to the embed function and parameters can be given to the ..., in which case missing parameters will be replaced by the ones in the @stdpars.

Parameters

Diffusion Maps can take the following parameters:

d

a function transforming a matrix row wise into a distance matrix or dist object, e.g. dist.

ndim

The number of dimensions

eps

The epsilon parameter that determines the diffusion weight matrix from a distance matrix d, exp(-d^2/eps), if set to "auto" it will be set to the median distance to the 0.01*n nearest neighbor.

t

Time-scale parameter. The recommended value, 0, uses multiscale geometry.

delta

Sparsity cut-off for the symmetric graph Laplacian, a higher value results in more sparsity and faster calculation. The predefined value is 10^-5.

Implementation

Wraps around diffuse, see there for details. It uses the notation of Richards et al. (2009) which is slightly different from the one in the original paper (Coifman and Lafon, 2006) and there is no α parameter. There is also an out-of-sample extension, see examples.

References

Richards, J.W., Freeman, P.E., Lee, A.B., Schafer, C.M., 2009. Exploiting Low-Dimensional Structure in Astronomical Spectra. ApJ 691, 32. doi:10.1088/0004-637X/691/1/32

Coifman, R.R., Lafon, S., 2006. Diffusion maps. Applied and Computational Harmonic Analysis 21, 5-30. doi:10.1016/j.acha.2006.04.006

See Also

Examples

dat <- loadDataSet("3D S Curve", n = 300)

## use the S4 Class directly:
diffmap <- DiffusionMaps()
emb <- diffmap@fun(dat, diffmap@stdpars)

## simpler, use embed():
emb2 <- embed(dat, "DiffusionMaps")

plot(emb, type = "2vars")

samp <- sample(floor(nrow(dat) / 10))
embsamp <- diffmap@fun(dat[samp], diffmap@stdpars)
embother <- embsamp@apply(dat[-samp])
plot(embsamp, type = "2vars")
points(embother@data)

dimRed

A Framework for Dimensionality Reduction

v0.2.3
GPL-3 | file LICENSE
Authors
Guido Kraemer [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.