Skip to content

Commit

Permalink
Compiled lda-newsgroups.RData and lda-nips.RData.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarbo committed Jul 16, 2024
1 parent 8b48376 commit 6101590
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ data/pbmc_68k.RData
data/GSE103354_Trachea_droplet_UMIcounts.txt.gz
data/droplet.RData
output/nips/fits-nips.RData
output/nips/lda-nips.RData
output/newsgroups/fits-newsgroups.RData
output/newsgroups/lda-newsgroups.RData
output/droplet/fits-droplet.RData
output/pbmc68k/fits-pbmc68k.RData
output/nips/rds/prefit-nips-k=*.rds
Expand Down
13 changes: 7 additions & 6 deletions scripts/compile_lda_runs.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ library(topicmodels)

# Combine results from all files of the form lda-*.rds in this
# directory.
out.dir <- "../output/nips/rds"

outdir <- "../output/droplet/rds"
rdafile <- "droplet-newsgroups.RData"

# List all the RDS files containing the model fits.
files <- Sys.glob(file.path(out.dir,"lda-*.rds"))
files <- Sys.glob(file.path(outdir,"lda-*.rds"))
n <- length(files)

# Set up two data structures: "fits", a list used to store all the
# results; and "dat", a data frame summarizing the model parameters
# and optimization settings used to produce these fits.
fits <- vector("list",n)
labels <- files
labels <- str_remove(labels,paste(out.dir,"/",sep = ""))
labels <- str_remove(labels,paste(outdir,"/",sep = ""))
labels <- str_remove(labels,".rds")
names(fits) <- labels
dat <- data.frame(label = labels,
Expand Down Expand Up @@ -47,5 +48,5 @@ dat <- transform(dat,k = factor(k))

# Save the combined results to an .RData file.
save(list = c("dat","fits"),
file = "lda.RData")
resaveRdaFiles("lda.RData")
file = rdafile)
resaveRdaFiles(rdafile)

0 comments on commit 6101590

Please sign in to comment.