library(bigMap)
# source graph plot
source('../graphs.R')
Load data
load('../s3d.RData')
Run Fit-SNE
source('~/FitSNE/fast_tsne.R', chdir = T)
# perplexities
ppx.list <- round(nrow(s3d$data) *c(.01, .05, .1, .2, .3, .4, .5, .6, .7, .8, .9, .95, .99), 0)
#
g.list <- lapply(ppx.list, function(ppx) {
t <- system.time(Y <- fftRtsne(s3d$data, perplexity = ppx))
# create bigMap instance
g <- list(dSet = 'S3D', is.distance = T, is.sparse = F, normalize = T, ppx = list(ppx = ppx), ptsne = list(Y = Y), t = t)
g <- bdm.knp(s3d$data, g, k.max = NULL, sampling = 0.9, threads = 4)
g <- bdm.hlCorr(s3d$data, g, zSampleSize = 1000, threads = 4)
g
})
save(g.list, file = './glist.RData')
hl-Correlation
hlTable <- sapply(g.list, function(g) summary(g$hlC)[4])
hlTable <- matrix(round(hlTable, 4), nrow = 1)
colnames(hlTable) <- sapply(g.list, function(g) g$ppx$ppx)
rownames(hlTable) <- c('<hlC>')
knitr::kable(hlTable, caption = 'hl-Correlation') %>%
kable_styling(full_width = F)
hl-Correlation
|
|
20
|
102
|
205
|
410
|
615
|
820
|
1025
|
1230
|
1435
|
1640
|
1845
|
1948
|
2030
|
|
<hlC>
|
0.7214
|
0.7157
|
0.7097
|
0.712
|
0.7222
|
0.7172
|
0.6975
|
0.7042
|
0.7253
|
0.7308
|
0.7292
|
0.7231
|
0.7293
|
Kary-neighborhood preservation
bdm.knp.plot(g.list)

Running Times
rTimes <- round(sapply(g.list, function(m) m$t$fitSNE[[3]]), 0)
rTimes <- matrix(rTimes, nrow = 1)
colnames(rTimes) <- sapply(g.list, function(m) m$ppx$ppx)
rownames(rTimes) <- c('FitSNE')
knitr::kable(rTimes, caption = 'Computation times (s)') %>%
kable_styling(full_width = F)
Computation times (s)
|
|
20
|
102
|
205
|
410
|
615
|
820
|
1025
|
1230
|
1435
|
1640
|
1845
|
1948
|
2030
|
|
FitSNE
|
25
|
17
|
20
|
26
|
33
|
36
|
36
|
36
|
36
|
35
|
36
|
36
|
35
|
Run on: Intel(R) Xeon(R) CPU E31225 @ 3.10GHz, 4 cores, 16GB RAM.