Adding more to analysis
This commit is contained in:
parent
7723128f93
commit
3a90551f68
1 changed files with 23 additions and 0 deletions
|
|
@ -42,3 +42,26 @@ ggplot(bench_df, aes(x = Rank, col = type)) +
|
||||||
scale_y_continuous(sec.axis = sec_axis(~ . / coeff, name = "Number of OTUs")) +
|
scale_y_continuous(sec.axis = sec_axis(~ . / coeff, name = "Number of OTUs")) +
|
||||||
labs(size = "Number of OTUs", color = "Algorithm Type", y = "Time (seconds)") +
|
labs(size = "Number of OTUs", color = "Algorithm Type", y = "Time (seconds)") +
|
||||||
theme_minimal()
|
theme_minimal()
|
||||||
|
|
||||||
|
seq_results <- lapply(seq_flist, function(file) readRDS(file)$models)
|
||||||
|
|
||||||
|
names(seq_results) <- paste0("Rep", seq_along(seq_results))
|
||||||
|
|
||||||
|
library(aricode)
|
||||||
|
seq_results <- transpose(seq_results)
|
||||||
|
lapply(seq_results, function(rank) {
|
||||||
|
rep1 <- rank$Rep1
|
||||||
|
memb1 <- rep1$memberships[[which.max(rep1$ICL)]]
|
||||||
|
|
||||||
|
|
||||||
|
rep2 <- rank$Rep2
|
||||||
|
memb2 <- rep2$memberships[[which.max(rep2$ICL)]]
|
||||||
|
|
||||||
|
Z11 <- apply(memb1$Z1, 1, which.max)
|
||||||
|
Z12 <- apply(memb2$Z1, 1, which.max)
|
||||||
|
|
||||||
|
Z21 <- apply(memb1$Z2, 1, which.max)
|
||||||
|
Z22 <- apply(memb2$Z2, 1, which.max)
|
||||||
|
|
||||||
|
c(ARI(Z11, Z12), ARI(Z21, Z22))
|
||||||
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue