Skip to content

Commit

Permalink
A few small updates to the exploratory scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarbo committed Jul 30, 2024
1 parent 5221f4d commit 3188e17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
14 changes: 5 additions & 9 deletions analysis/examine_newsgroups_more.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# For paper, highlight results with K = 10.
library(fastTopics)
library(cowplot)
set.seed(1)
Expand All @@ -10,18 +11,13 @@ n <- nrow(fit1$L)
rows <- sample(n,2000)
fit1 <- select_loadings(fit1,rows)
fit2 <- select_loadings(fit2,rows)
tsne <- tsne_from_topics(fit1,dims = 1,verbose = FALSE)
p1 <- structure_plot(fit1,loadings_order = order(tsne[,1]),topics = 1:k,
grouping = topics[rows])
p2 <- structure_plot(fit2,loadings_order = order(tsne[,1]),topics = 1:k,
grouping = topics[rows])
p1 <- structure_plot(fit1,topics = 1:k,grouping = topics[rows])
p2 <- structure_plot(fit2,topics = 1:k,grouping = topics[rows])
plot_grid(p1,p2,nrow = 2,ncol = 1)

lda1 <- readRDS("../output/newsgroups/rds/lda-newsgroups-em-k=10.rds")$lda
lda2 <- readRDS("../output/newsgroups/rds/lda-newsgroups-scd-ex-k=10.rds")$lda
cor(lda1@gamma,lda2@gamma)
p3 <- structure_plot(lda1@gamma[rows,],loadings_order = order(tsne[,1]),
topics = 1:k)
p4 <- structure_plot(lda2@gamma[rows,],loadings_order = order(tsne[,1]),
topics = 1:k)
p3 <- structure_plot(lda1@gamma[rows,],topics = 1:k)
p4 <- structure_plot(lda2@gamma[rows,],topics = 1:k)
plot_grid(p1,p2,p3,p4,nrow = 4,ncol = 1)
1 change: 1 addition & 0 deletions analysis/examine_pbmc68k_more.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# For paper, highlight results with K = 11.
library(fastTopics)
library(cowplot)
set.seed(1)
Expand Down

0 comments on commit 3188e17

Please sign in to comment.