Description Usage Arguments Value References Examples

Project new data into an existing t-SNE embedding object.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |

`x` |
t-SNE embedding created with |

`new` |
New data to project into existing embedding |

`old` |
Data used to create the original embedding. |

`perplexity` |
Numeric scalar. Perplexity can be thought of as the continuous number of nearest neighbors, for which t-SNE will attempt to preserve distances. However, when projecting, we only consider neighbors in the existing embedding i.e. each data point is placed into the embedding, independently of other new data points. |

`initialization` |
Character scalar specifying the method used to compute the initial point positions to be used in the embedding space. Can be "median", "weighted" or "random". In all cases, "median" or "weighted" should be preferred. |

`k` |
Integer scalar specifying the number of nearest neighbors to consider when initially placing the point onto the embedding. This is different from "perplexity" because perplexity affects optimization while this only affects the initial point positions. |

`learning_rate` |
The learning rate for t-SNE optimization.
When |

`early_exaggeration` |
Numeric scalar; the exaggeration factor to use during the *early exaggeration* phase. Typical values range from 12 to 32. |

`early_exaggeration_iter` |
The number of iterations to run in the *early exaggeration* phase. |

`exaggeration` |
The exaggeration factor to use during the normal optimization phase. This can be used to form more densely packed clusters and is useful for large data sets. |

`n_iter` |
The number of iterations to run in the normal optimization regime. |

`initial_momentum` |
The momentum to use during the *early exaggeration* phase. |

`final_momentum` |
The momentum to use during the normal optimization phase. |

`max_grad_norm` |
Maximum gradient norm. If the norm exceeds this value, it will be clipped. When adding points into an existing embedding, and the new points overlap with the reference points, this may lead to large gradients. This can make points "shoot off" from the embedding, causing the interpolation method to compute a very large grid, and leads to worse results. |

`tolerance` |
Numeric scalar specifying the numeric tolerance used to ensure the affinities calculated on the old data match those of the original embedding. |

Numeric matrix of t-SNE co-ordinates resulting from embedding
`new`

into the t-SNE embedding `x`

.

Automated optimized parameters for T-distributed stochastic neighbor embedding improve visualization and analysis of large datasets. Belkina, A.C., Ciccolella, C.O., Anno, R. et al. Nature Communications 10, 5415 (2019). doi: https://doi.org/10.1038/s41467-019-13055-y

1 2 3 4 5 6 7 | ```
set.seed(42)
m <- matrix(rnorm(2000), ncol=20)
out_binding <- fitsne(m[-(1:2), ], random_state = 42L)
new_points <- project(out_binding, new = m[1:2, ], old = m[-(1:2), ])
plot(as.matrix(out_binding), col = "black", pch = 19,
xlab = "t-SNE 1", ylab = "t-SNE 2")
points(new_points, col = "red", pch = 19)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.