Verified Commit bd22b541 authored by Cody L Marquart's avatar Cody L Marquart
Browse files

computerSet fixes

parent d1f908bb
Pipeline #46366 failed with stages
in 4 minutes and 21 seconds
......@@ -75,13 +75,13 @@ getHandSetIndices2 = function(
autocoded = codeToUse$process(codeToUse$excerpts[randIndice])
if(autocoded == 1){
positives = positives - 1;
this.set = c(this.set, randIndice) # only adding positive indices to handset
# this.set = c(this.set, randIndice) # only adding positive indices to handset
# codeToUse$computerSet = rbind(codeToUse$computerSet, data.frame("ID" = randIndice, "X1" = autocoded))
codeToUse$computerSet = rbind(codeToUse$computerSet, c(randIndice, autocoded))
}
else{ # deal with nonPositive excerpt case
if(maxNonPositives != 0){ # room in handSet to add nonPositive -> add it
this.set = c(this.set, randIndice)
# this.set = c(this.set, randIndice)
maxNonPositives = maxNonPositives - 1;
# codeToUse$computerSet = rbind(codeToUse$computerSet, data.frame("ID" = randIndice, "X1" = autocoded))
codeToUse$computerSet = rbind(codeToUse$computerSet, c(randIndice, autocoded))
......@@ -96,8 +96,10 @@ getHandSetIndices2 = function(
if(maxNonPositives != 0){
for(i in 1:maxNonPositives){
randIndice = sample(indices[!is.na(indices)],1)
autocoded = codeToUse$process(codeToUse$excerpts[randIndice])
indices[randIndice] = NA
this.set = c(this.set, randIndice)
# this.set = c(this.set, randIndice)
codeToUse$computerSet = rbind(codeToUse$computerSet, c(randIndice, autocoded))
}
}
......@@ -108,7 +110,8 @@ getHandSetIndices2 = function(
# randomize output order of indices
codeToUse$testSet = rbind(
codeToUse$testSet,
data.frame(ID=this.set[sample.int(n = handSetLength)], X1=NA)
#data.frame(ID=this.set[sample.int(n = handSetLength)], X1=NA)
data.frame(ID=codeToUse$computerSet[,1][sample.int(n = handSetLength)], X1=NA)
)
}
else {
......
Markdown is supported
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