Skip to contents

Native exact t-SNE (van der Maaten & Hinton 2008): perplexity- calibrated Gaussian affinities via per-point binary search, PCA preprocessing to 50 components, early exaggeration, and momentum gradient descent on the KL divergence. O(n^2) – appropriate for the module-scale inputs this helper serves. Replaces the Rtsne delegation; embedding quality is cross-validated against Rtsne in tests (KL divergence + neighbourhood recall).

Usage

morie_tsne_reduction(
  x,
  n_components = 2L,
  perplexity = 30,
  learning_rate = "auto",
  n_iter = 1000L,
  seed = 0L,
  deterministic_seed = NULL
)

Arguments

x

Numeric matrix.

n_components

Embedding dimension.

perplexity

t-SNE perplexity.

learning_rate

Gradient-descent learning rate; "auto" selects max(n/12, 50).

n_iter

Max iterations.

seed

RNG seed.

deterministic_seed

Integer or NULL. If supplied, the RNG state is derived from the SHA-keyed morie_det_rng() so Py<->R streams agree on the canonical fixture. When NULL (default), behaviour is unchanged: seed drives set.seed() directly.

Value

Named list: estimate (shape), embedding, kl_divergence, perplexity, n_components, n, method.

Examples

# See the package vignettes for usage examples:
#   vignette(package = "rmorie")