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

handset fixes

parent cc71b1cc
Pipeline #45793 failed with stages
in 1 minute and 52 seconds
......@@ -38,11 +38,13 @@ test <- function(code, kappa_threshold = 0.65, baserate_inflation = 0.2) {
second_v_classifier <- NULL
if(nrow(code$testSet) > 0) {
to.test <- merge(code.to.use$computerSet, code.to.use$testSet, by = "ID")
first_v_classifier_test = calc_statistics(to.test)
if(!any(is.na(to.test[, 2:3])))
first_v_classifier_test = calc_statistics(to.test)
}
if(nrow(code.to.use$trainingSet) > 0) {
to.test = merge(code.to.use$computerSet, code.to.use$trainingSet, by = "ID")
first_v_classifier_train = calc_statistics(to.test)
if(!any(is.na(to.test[, 2:3])))
first_v_classifier_train = calc_statistics(to.test)
}
first_v_classifier <- test_result(
......
......@@ -75,13 +75,31 @@ getHandSetIndices2 = function(
if(autocoded == 1){
positives = positives - 1;
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, data.frame("ID" = randIndice, "X1" = autocoded))
codeToUse$computerSet = rbind(
codeToUse$computerSet,
structure(
list( ID=randIndice, X1=autocoded),
row.names=c(NA, -1L),
class="data.frame",
names = names(codeToUse$computerSet)
)
)
}
else{ # deal with nonPositive excerpt case
if(maxNonPositives != 0){ # room in handSet to add nonPositive -> add it
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, data.frame("ID" = randIndice, "X1" = autocoded))
codeToUse$computerSet = rbind(
codeToUse$computerSet,
structure(
list( ID=randIndice, X1=autocoded),
row.names=c(NA, -1L),
class="data.frame",
names = names(codeToUse$computerSet)
)
)
}
else{ # if max number of nonPositve indices is reached, save indice, but don't add to set
codeToUse$touchedIndices = c(codeToUse$touchedIndices, randIndice)
......
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