reduce_tsne: t-distributed stochastic neighbor embedding (t-SNE)

Description Usage Arguments Value References See Also Examples

Description

Apply t-SNE to a matrix or poplin object. This is an interface to the Rtsne function from the Rtsne package. t-SNE is well-suited for visualizing high-dimensional data by giving each data point a location in a two or three-dimensional map.

Usage

1
2
3
4
5
## S4 method for signature 'matrix'
reduce_tsne(x, ncomp = 2, normalize = TRUE, ...)

## S4 method for signature 'poplin'
reduce_tsne(x, xin, xout, ncomp = 2, normalize = TRUE, ...)

Arguments

x

A matrix or poplin object.

ncomp

Output dimensionality.

normalize

Logical controlling whether the input matrix is mean-centered and scaled so that the largest absolute of the centered matrix is equal to unity. See normalize_input for details.

...

Additional arguments passed to Rtsne.

xin

character specifying the name of data to retrieve from x when x is a poplin object.

xout

Character specifying the name of data to store in x when x is a poplin object.

Value

A poplin.tsne or poplin object with the same number of rows as ncol(x) containing the dimension reduction result. poplin.tsne is a matrix containing custom attributes used to summarize and visualize the t-SNE result.

References

L.J.P. van der Maaten and G.E. Hinton. Visualizing High-Dimensional Data Using t-SNE. Journal of Machine Learning Research 9(Nov):2579-2605, 2008.

L.J.P. van der Maaten. Accelerating t-SNE using Tree-Based Algorithms. Journal of Machine Learning Research 15(Oct):3221-3245, 2014.

Jesse H. Krijthe (2015). Rtsne: T-Distributed Stochastic Neighbor Embedding using a Barnes-Hut Implementation, URL: https://github.com/jkrijthe/Rtsne

See Also

Other data reduction methods: poplin_reduce(), reduce_pca(), reduce_plsda()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(faahko_poplin)

if (requireNamespace("Rtsne", quietly = TRUE)) {
  ## poplin object
  out <- reduce_tsne(faahko_poplin, xin = "knn_cyclic", xout = "tsne",
                     normalize = TRUE, perplexity = 3)
  summary(poplin_reduced(out, "tsne"))

  ## matrix
  m <- poplin_data(faahko_poplin, "knn_cyclic")
  out <- reduce_tsne(m, normalize = TRUE, perplexity = 3, ncomp = 3)
  summary(out)
}

jaehyunjoo/poplin documentation built on Jan. 8, 2022, 1:13 a.m.