t-SNE
## sigma summary: Min. : 0.217748803762076 |1st Qu. : 0.404340137543283 |Median : 0.451107099547681 |Mean : 0.481763911113029 |3rd Qu. : 0.539478440739728 |Max. : 1.36797455402298 |
## Epoch: Iteration #100 error is: 16.5602436783057
## Epoch: Iteration #200 error is: 1.11709862171616
## Epoch: Iteration #300 error is: 1.04840821156237
## Epoch: Iteration #400 error is: 1.0310143333729
## Epoch: Iteration #500 error is: 1.02613937403733
## Epoch: Iteration #600 error is: 1.02418673930287
## Epoch: Iteration #700 error is: 1.02311030926147
## Epoch: Iteration #800 error is: 1.0224210553102
## Epoch: Iteration #900 error is: 1.02193604553137
## Epoch: Iteration #1000 error is: 1.0215718268106
Restricting hGMM to \(K = 2\)
Here we are restricting hierarchical GMM to only go through on level. We are comparing the cluster results to the gaba
labels.
set.seed(3144)
h2 <- hmc(edat, maxDepth = 2, ccol = ccol)
h2lab <- viridis(max(h2$dat$labels$col))
h2col <- h2$dat$labels$col
K = 2 stacked means plot
p1 <- stackM(h2, ccol = "black", centered = TRUE, depth = 1)
L1 <- h2$dat$labels$L1
p2 <- stackMraw(as.data.frame(sdat), L1, ccol = ccol, depth = 2, centered = TRUE)
grid.arrange(p1, p2, nrow = 1)
Pairs plot colored by true gaba classification
cols <- c("black", "magenta")[gabaID$gaba+1]
acols <- alpha(cols, 0.35)
#pairs(h2$dat$data, pch = 19, cex = 0.7, col = acols)
plot(h2$dat$data, col = acols, pch = c(19,3)[gaba+1], cex = c(0.5,1)[gaba+1])
#pairs(sdat, col = acols, pch = c(19,3)[gaba+1], cex = c(0.5,1)[gaba+1])
Pairs plot colored by hGMM cluster classification
acols2 <- alpha(h2lab[h2$dat$labels$col], 0.45)
par(bg = "gray45")
plot(h2$dat$data, pch = c(3,20)[gaba + 1], cex = 1, col = acols2)
#pairs(sdat, pch = 19, cex = 0.7, col = acols2)
dev.off()
## quartz
## 2
Permutation test for ARI
p0 <- mclust::adjustedRandIndex(pred, gaba)
perms <- foreach(i = 1:1.5e4, .combine = c) %dopar% {
set.seed(i*3)
mclust::adjustedRandIndex(sample(pred), gaba)
}
pv0 <- sum(c(perms,p0) >= p0)/length(perms)
hist(perms, xlim = c(min(perms), p0 + 0.25*p0),
main = "permutation test of ARI values", probability = TRUE)
#hist(perms, probability = TRUE)
abline(v = p0, col = 'red')
## truth
## pred FALSE TRUE
## FALSE 319 80
## TRUE 389 5