if (FALSE) {
register_tsne()
# distances
get_seriation_method("dist", "tsne")
data(SupremeCourt)
d <- as.dist(SupremeCourt)
o <- seriate(d, method = "tsne", verbose = TRUE)
pimage(d, o)
# look at the returned configuration and plot it
attr(o[[1]], "configuration")
plot_config(o)
# the t-SNE results are also available as an attribute (see ? Rtsne::Rtsne)
attr(o[[1]], "model")
## matrix
get_seriation_method("matrix", "tsne")
data("Zoo")
x <- Zoo
x[,"legs"] <- (x[,"legs"] > 0)
# t-SNE does not allow duplicates
x <- x[!duplicated(x), , drop = FALSE]
class <- x$class
label <- rownames(x)
x <- as.matrix(x[,-17])
o <- seriate(x, method = "tsne", eta = 10, verbose = TRUE)
pimage(x, o, prop = FALSE, row_labels = TRUE, col_labels = TRUE)
# look at the row embedding
plot_config(o[[1]], col = class)
}
Run the code above in your browser using DataLab