Skip to contents

t-SNE takes high-dimensional data and reduces it to a low-dimensional graph (1-3 dimensions). Unlike PCA, t-SNE can reduce dimensions with non-linear relationships. PCA attempts to draw the best fitting line through the distribution. T-SNE calculates a similarity measure based on the distance between points instead of trying to maximize variance.

Usage

reduce_tsne(df, n = 2, ignore = NULL, quiet = FALSE, plot = TRUE, ...)

Arguments

df

Dataframe

n

Integer. Number of dimensions to reduce to.

ignore

Character vector. Names of columns to ignore.

quiet

Boolean. Keep quiet? If not, print messages.

plot

Boolean. Create plots?

...

Additional parameters passed to Rtsne::Rtsne

Value

List with reduced dataframe and possible plots.

See also

Other Dimensionality: reduce_pca()

Other Clusters: clusterKmeans(), clusterOptimalK(), clusterVisualK(), reduce_pca()

Examples

if (FALSE) { # \dontrun{
data("iris")
df <- subset(iris, select = c(-Species))
df$id <- seq_len(nrow(df))
reduce_tsne(df, ignore = "id", max_iter = 800, perplexity = 20)
} # }