Commit 610a7d3f authored by Marco Chierici's avatar Marco Chierici
Browse files

Added random seed as variable

parent ced6744b
......@@ -16,6 +16,7 @@ OUTROOT <- DATADIR
tumor <- "Breast"
targets <- list(ER="clin:breast_carcinoma_estrogen_receptor_status", subtypes="clin:PAM50Call")
task <- "ER"
base.seed <- 78 # use 78 to (re)generate the "main" set of splits
# task-independent: generate a merged file from available omics layers
mergedFile <- file.path(OUTROOT, tumor, "merged.txt")
......@@ -77,8 +78,7 @@ foreach(split.id=seq(0, 9), .verbose=FALSE) %dopar% {
outdir <- file.path(OUTROOT, tumor, "INF", ifelse(task=="ER", "breast_ER", task), split.id)
if(!dir.exists(outdir))
dir.create(outdir, recursive=TRUE)
# make it so that the 1st split is for set.seed(78), which was the one created previously
set.seed(78+split.id)
set.seed(base.seed+split.id)
train.idx <- caret::createDataPartition(y=y, p=0.7, list=FALSE)
train.data <- mrg.sub[train.idx,]
train.lab <- y[train.idx]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment