This repository has been archived by the owner on Dec 30, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.Rmd
57 lines (43 loc) · 1.64 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
output:
md_document:
variant: markdown_github
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# R wrapper for multicore Tsne
##Installation
To install the latest version from the github repository, use:
```{r, eval = FALSE}
if(!require(devtools)) install.packages("devtools") # If not already installed
devtools::install_github("RGLab/Rtsne.multicore")
```
##Usage
After installing the package, use the following code to run a simple example (to install, see below).
```{r example, fig.path="tools/"}
library(Rtsne.multicore) # Load package
iris_unique <- unique(iris) # Remove duplicates
mat <- as.matrix(iris_unique[,1:4])
set.seed(42) # Sets seed for reproducibility
tsne_out <- Rtsne.multicore(mat) # Run TSNE
plot(tsne_out$Y,col=iris_unique$Species) # Plot the result
```
##benchmark
```{r}
library(microbenchmark)
library(Rtsne)
microbenchmark(tsne_out <- Rtsne.multicore(mat, num_threads = 4), tsne_out <- Rtsne(mat), times = 10)
```
#Details
This R package offers a wrapper around multicore Barnes-Hut TSNE C++ implementation. Only minor changes were made to the original code to allow it to function as an R package.
#References
[1] L.J.P. van der Maaten and G.E. Hinton. Visualizing High-Dimensional Data Using t-SNE. Journal of Machine Learning Research 9(Nov):2579-2605, 2008.
[2] L.J.P. van der Maaten. Barnes-Hut-SNE. In Proceedings of the International Conference on Learning Representations, 2013.
[3] http://homepage.tudelft.nl/19j49/t-SNE.html
[4] https://github.com/DmitryUlyanov/Multicore-TSNE