Welcome to the documentation for sneer
: Stochastic Neighbor Embedding Experiments in R. It’s a pure R package for carrying out not only the popular t-distributed SNE, but also other related dimensionality reduction methods.
Make sure you have the devtools
package installed, then use that to install sneer
:
install.packages("devtools")
devtools::install_github("jlmelville/sneer")
The different options available in sneer are covered by the sections below.
sneer
.embedder
function.sneer
(and the extra data you can ask for).The examples page brings most of this together. The same examples can be found in the R documentation for the sneer
function, i.e. type ?sneer
at the R console.
Don’t want to deal with all those options? Ok, let’s use the iris data set as an example.
library("sneer")
res <- sneer(iris)
You should see a running commentary on what sneer is doing being logged to the console, including the iteration number, some error values (that get smaller) and convergence information. After 1000 iterations, it stops.
Also, we saw a plot of the iris data, in three colored clusters slowly changing shape as the embedding converged. Hopefully, it looks a bit like:
If you know anything about the iris data set the result shouldn’t be very surprising.
Anyway, the embedded coordinates are in the matrix res$coords
. You probably have a much better idea about how to display and analyze the results than I do. Off you go. Have fun.
If you are at all curious about how the gradients are derived, perhaps because you would like to tweak a cost function or similarity function, take a look at the gradients page.
Some other increasingly arcane gradient derivations are also available, which are mainly just attempts to demonstrate how specific literature variations can be treated within a generic framework.
Available at https://github.com/jlmelville/sneer