Nothing
#' tSNE
#' @inheritParams dimred
#' @inheritParams Rtsne::Rtsne
#' @seealso [Rtsne::Rtsne()]
#' @export
#'
#' @examples
#' library(Matrix)
#' dataset <- abs(Matrix::rsparsematrix(100, 100, .5))
#' dimred_tsne(dataset, ndim = 3)
dimred_tsne <- function(x, ndim = 2, perplexity = 30, theta = 0.5, initial_dims = 50, distance_method) {
requireNamespace("Rtsne")
distance_method <- match.arg(distance_method)
dis <- calculate_distance(x, method = distance_method)
space <- Rtsne::Rtsne(
as.dist(dis),
dims = ndim,
is_distance = TRUE,
perplexity = perplexity,
theta = theta,
initial_dims = initial_dims
)$Y
.process_dimred(space, rownames(x))
}
formals(dimred_tsne)$distance_method <- dynutils::list_distance_methods()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.