Running ‘run-all.R’ [9s/13s]
Running the tests in ‘tests/run-all.R’ failed.
Complete output:
  > library(testthat)
  > library(ParamHelpers)
  > 
  > test_check("llama")
  Loading required package: llama
  Loading required package: mlr
  ── 1. Error: classify classifies (@test.classify.R#2)  ─────────────────────────
  argument "def" is missing, with no default
  1: classify(classifier = testclassifier, d) at testthat/test.classify.R:2
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 2. Error: classify returns predictor (@test.classify.R#11)  ─────────────────
  argument "def" is missing, with no default
  1: classify(classifier = testclassifier, d) at testthat/test.classify.R:11
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 3. Error: classify returns predictor that works without IDs (@test.classify.R
  argument "def" is missing, with no default
  1: classify(classifier = testclassifier, d) at testthat/test.classify.R:22
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 4. Error: classify takes list of classifiers (@test.classify.R#45)  ─────────
  argument "def" is missing, with no default
  1: classify(classifier = list(testclassifier, testclassifier, testclassifier), d) at testthat/test.classify.R:45
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 5. Error: classify takes list of classifiers and combination function (@test.
  argument "def" is missing, with no default
  1: classify(classifier = list(foo, foo, foo, .combine = othertestclassifier), e) at testthat/test.classify.R:62
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 6. Error: classify ensemble does majority voting by default (@test.classify.R
  argument "def" is missing, with no default
  1: classify(classifier = list(testclassifier, othertestclassifier, othertestclassifier), 
         e) at testthat/test.classify.R:79
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 7. Error: classify works with NA predictions (@test.classify.R#96)  ─────────
  argument "def" is missing, with no default
  1: classify(classifier = natestclassifier, d) at testthat/test.classify.R:96
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 8. Error: classify works with probabilities (@test.classify.R#158)  ─────────
  argument "def" is missing, with no default
  1: classify(classifier = probtestclassifier, d) at testthat/test.classify.R:158
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 9. Error: classifyPairs classifies (@test.classifyPairs.R#2)  ───────────────
  argument "def" is missing, with no default
  1: classifyPairs(classifier = idtestclassifier, d) at testthat/test.classifyPairs.R:2
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 10. Error: classifyPairs returns predictor (@test.classifyPairs.R#11)  ──────
  argument "def" is missing, with no default
  1: classifyPairs(classifier = idtestclassifier, d) at testthat/test.classifyPairs.R:11
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 11. Error: classifyPairs returns predictor that works without IDs (@test.clas
  argument "def" is missing, with no default
  1: classifyPairs(classifier = idtestclassifier, d) at testthat/test.classifyPairs.R:22
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 12. Error: classifyPairs respects minimize (@test.classifyPairs.R#45)  ──────
  argument "def" is missing, with no default
  1: classifyPairs(classifier = idtestclassifier, d) at testthat/test.classifyPairs.R:45
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 13. Error: classifyPairs allows combination function (@test.classifyPairs.R#6
  argument "def" is missing, with no default
  1: classifyPairs(classifier = idtestclassifier, e, combine = othertestclassifier) at testthat/test.classifyPairs.R:62
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 14. Error: classifyPairs works with NA predictions (@test.classifyPairs.R#79)
  argument "def" is missing, with no default
  1: classifyPairs(classifier = natestclassifier, d) at testthat/test.classifyPairs.R:79
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 15. Error: classifyPairs works with probabilities (@test.classifyPairs.R#113)
  argument "def" is missing, with no default
  1: classifyPairs(classifier = probtestclassifier, d) at testthat/test.classifyPairs.R:113
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = list()
         pairpredictions = list()
         for (j in 1:ncol(combns)) {
             if (data$minimize) {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] < data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             else {
                 cmp = function(x, y) {
                     sapply(data$data[data$train[[i]], ][x] > data$data[data$train[[i]], 
                       ][y], function(z) {
                       if (z) {
                         x
                       }
                       else {
                         y
                       }
                     })
                 }
             }
             labels = data.frame(target = factor(cmp(combns[1, j], combns[2, j])))
             if (hasLearnerProperties(classifier, "weights") && use.weights) {
                 trw = abs(data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                     combns[2, j]])
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(labels, trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(labels, 
                     trf$features), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(labels$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier$id, combns[1, j], combns[2, 
                       j], i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, preds$task.desc$class.levels)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             pairpredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "classifyPairs", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "classifyPairs", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions), fixup.data = "quiet", check.data = FALSE)
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combine, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     pairpredictions)), file = paste(save.models, combine$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, pairpredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, preds$task.desc$class.levels)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", pairpredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 16. Error: cluster finds best for cluster (@test.cluster.R#18)  ─────────────
  argument "def" is missing, with no default
  1: cluster(testclusterer, g) at testthat/test.cluster.R:18
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 17. Error: cluster finds best by count for cluster (@test.cluster.R#28)  ────
  argument "def" is missing, with no default
  1: cluster(testclusterer, g, bestBy = "count") at testthat/test.cluster.R:28
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 18. Error: cluster finds best by successes for cluster (@test.cluster.R#37)  
  argument "def" is missing, with no default
  1: cluster(testclusterer, g, bestBy = "successes") at testthat/test.cluster.R:37
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 19. Error: cluster returns predictor (@test.cluster.R#46)  ──────────────────
  argument "def" is missing, with no default
  1: cluster(testclusterer, g) at testthat/test.cluster.R:46
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 20. Error: cluster returns predictor that works without IDs (@test.cluster.R#
  argument "def" is missing, with no default
  1: cluster(testclusterer, g) at testthat/test.cluster.R:58
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 21. Error: cluster takes list of clusterers (@test.cluster.R#70)  ───────────
  argument "def" is missing, with no default
  1: cluster(list(testclusterer, testclusterer, testclusterer), g) at testthat/test.cluster.R:70
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 22. Error: cluster takes list of clusterers and combinator (@test.cluster.R#8
  argument "def" is missing, with no default
  1: cluster(list(testclusterer, testclusterer, testclusterer, .combine = idtestclassifier), 
         g) at testthat/test.cluster.R:88
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 23. Error: cluster works with NA predictions (@test.cluster.R#105)  ─────────
  argument "def" is missing, with no default
  1: cluster(natestclusterer, d) at testthat/test.cluster.R:105
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = length(clusterer))
         ensemblepredictions = list()
         for (j in 1:length(clusterer)) {
             task = makeClusterTask(id = "clustering", data = trf$features)
             model = train(clusterer[[j]], task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, clusterer[[j]]$id, i, "rds", sep = "."))
             }
             trainclusters = getPredictionResponse(predict(model, newdata = trf$features))
             if (all(is.na(trainclusters))) {
                 best = bestfun(data$data[data$train[[i]], ])
             }
             else {
                 best = by(data$data[data$train[[i]], ], trainclusters, bestfun)
             }
             if (inherits(combinator, "Learner")) {
                 trainpredictions[, j] = factor(sapply(getPredictionResponse(predict(model, 
                     newdata = trf$features)), function(x) {
                     if (is.na(x)) {
                       factor(NA)
                     }
                     else {
                       best[[which(names(best) == x)]][1, 1]
                     }
                 }))
             }
             preds = getPredictionResponse(predict(model, newdata = tsf$features))
             ensemblepredictions[[j]] = list()
             for (k in 1:length(preds)) {
                 x = preds[k]
                 if (is.na(x)) {
                     ensemblepredictions[[j]][[k]] = data.frame(algorithm = NA, score = worstScore)
                 }
                 else {
                     ensemblepredictions[[j]][[k]] = best[[which(names(best) == x)]]
                 }
             }
         }
         if (inherits(combinator, "Learner")) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             task = makeClassifTask(id = "cluster", target = "target", data = cbind(trainBests, 
                 trf$features, data.frame(trainpredictions)))
             combinedmodel = train(combinator, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(featureData))), file = paste(save.models, combinator$id, 
                     "combined", i, "rds", sep = "."))
             }
             featureData = matrix(nrow = nrow(tsf$features), ncol = length(clusterer))
             for (k in 1:nrow(featureData)) {
                 for (j in 1:ncol(featureData)) {
                     featureData[k, j] = ensemblepredictions[[j]][[k]][1, 1]
                 }
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(featureData))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(ids), function(j) {
                 df = rbind.fill(lapply(ensemblepredictions, function(x) {
                     x[[j]]
                 }))
                 if (all(is.na(df$algorithm))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     df = aggregate(data = df, as.formula(paste(predNames[2], predNames[1], 
                       sep = "~")), sum)
                     df$iteration = i
                     cbind(ids[j, , drop = F], df, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 24. Error: regression predicts (@test.regression.R#2)  ──────────────────────
  argument "def" is missing, with no default
  1: regression(testregressor, d) at testthat/test.regression.R:2
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 25. Error: regression returns predictor (@test.regression.R#11)  ────────────
  argument "def" is missing, with no default
  1: regression(testregressor, d) at testthat/test.regression.R:11
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 26. Error: regression returns predictor that works without IDs (@test.regress
  argument "def" is missing, with no default
  1: regression(testregressor, d) at testthat/test.regression.R:22
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 27. Error: regression allows to combine by max (@test.regression.R#54)  ─────
  argument "def" is missing, with no default
  1: regression(testregressor, d) at testthat/test.regression.R:54
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 28. Error: regression allows stacking (@test.regression.R#71)  ──────────────
  argument "def" is missing, with no default
  1: regression(testregressor, d, combine = idtestclassifier) at testthat/test.regression.R:71
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 29. Error: regression works with NA predictions (@test.regression.R#88)  ────
  argument "def" is missing, with no default
  1: regression(natestregressor, d) at testthat/test.regression.R:88
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 30. Error: regression works with single algorithm (@test.regression.R#120)  ─
  argument "def" is missing, with no default
  1: regression(testregressor, dp) at testthat/test.regression.R:120
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = data.frame(row.names = 1:nrow(trf$features))
         performancePredictions = data.frame(row.names = 1:nrow(tsf$features))
         for (j in 1:length(data$performance)) {
             task = makeRegrTask(id = "regression", target = "target", data = cbind(data.frame(target = data$data[data$train[[i]], 
                 data$performance[j]]), trf$features))
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, data$performance[[j]], i, 
                       "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             performancePredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         colnames(performancePredictions) = data$performance
         if (!is.null(combine)) {
             colnames(trainpredictions) = data$performance
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(expand(trainpredictions))))
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(expand(trainpredictions))))
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(expand(performancePredictions)))), file = paste(save.models, 
                     combine$id, "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(expand(performancePredictions)))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = as.table(sort(table(preds[j, drop = F]), decreasing = T))
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             combinedpredictions = rbind.fill(lapply(1:nrow(performancePredictions), function(j) {
                 if (all(is.na(performancePredictions[j, ]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     x = sort(performancePredictions[j, , drop = F], decreasing = !data$minimize)
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 31. Error: regressionPairs predicts (@test.regressionPairs.R#2)  ────────────
  argument "def" is missing, with no default
  1: regressionPairs(regressor = testregressor, d) at testthat/test.regressionPairs.R:2
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 32. Error: regressionPairs returns predictor (@test.regressionPairs.R#11)  ──
  argument "def" is missing, with no default
  1: regressionPairs(regressor = testregressor, d) at testthat/test.regressionPairs.R:11
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 33. Error: regressionPairs returns predictor that works without IDs (@test.re
  argument "def" is missing, with no default
  1: regressionPairs(regressor = testregressor, d) at testthat/test.regressionPairs.R:22
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 34. Error: regressionPairs respects minimize (@test.regressionPairs.R#54)  ──
  argument "def" is missing, with no default
  1: regressionPairs(regressor = testregressor, d) at testthat/test.regressionPairs.R:54
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 35. Error: regressionPairs allows combine classifier (@test.regressionPairs.R
  argument "def" is missing, with no default
  1: regressionPairs(regressor = testregressor, d, combine = idtestclassifier) at testthat/test.regressionPairs.R:71
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 36. Error: regression works with NA predictions (@test.regressionPairs.R#88) 
  argument "def" is missing, with no default
  1: regressionPairs(natestregressor, d) at testthat/test.regressionPairs.R:88
  2: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  3: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trainpredictions = matrix(nrow = nrow(trf$features), ncol = ncol(combns))
         pairpredictions = matrix(nrow = nrow(tsf$features), ncol = ncol(combns))
         for (j in 1:ncol(combns)) {
             values = data.frame(target = data$data[data$train[[i]], combns[1, j]] - data$data[data$train[[i]], 
                 combns[2, j]])
             task = makeRegrTask(id = "regression", target = "target", data = cbind(values, 
                 trf$features), fixup.data = "quiet")
             model = train(regressor, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, regressor$id, combns[1, j], combns[2, j], 
                       i, "rds", sep = "."))
             }
             if (!is.null(combine)) {
                 trainpredictions[, j] = getPredictionResponse(predict(model, newdata = trf$features))
             }
             pairpredictions[, j] = getPredictionResponse(predict(model, newdata = tsf$features))
         }
         if (!is.null(combine)) {
             trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
             if (hasLearnerProperties(combine, "weights") && use.weights) {
                 trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
                 task = makeClassifTask(id = "regression", target = "target", weights = trw, 
                     data = cbind(trainBests, trf$features, data.frame(trainpredictions)), 
                     fixup.data = "quiet", check.data = FALSE)
             }
             else {
                 task = makeClassifTask(id = "regression", target = "target", data = cbind(trainBests, 
                     trf$features, data.frame(trainpredictions)), fixup.data = "quiet", 
                     check.data = FALSE)
             }
             combinedmodel = train(combine, task = task)
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = cbind(tsf$features, 
                     data.frame(pairpredictions))), file = paste(save.models, combine$id, 
                     "combined", i, "rds", sep = "."))
             }
             preds = getPredictionResponse(predict(combinedmodel, newdata = cbind(tsf$features, 
                 data.frame(pairpredictions))))
             combinedpredictions = rbind.fill(lapply(1:length(preds), function(j) {
                 if (all(is.na(preds[j, drop = F]))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     tab = table(preds[j, drop = F])
                     data.frame(ids[j, , drop = F], algorithm = names(tab), score = as.vector(tab), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         else {
             if (data$minimize) {
                 sign = function(d) {
                     return(-d)
                 }
             }
             else {
                 sign = function(d) {
                     return(d)
                 }
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(pairpredictions), function(j) {
                 row = pairpredictions[j, ]
                 performanceSums = sapply(data$performance, function(p) {
                     sum(sapply(1:ncol(combns), signPair, p, sign, row, combns))
                 })
                 x = sort(performanceSums, decreasing = TRUE)
                 if (all(is.na(x))) {
                     data.frame(ids[j, , drop = F], algorithm = NA, score = worstScore, 
                       iteration = i, row.names = NULL)
                 }
                 else {
                     data.frame(ids[j, , drop = F], algorithm = names(x), score = unlist(x), 
                       iteration = i, row.names = NULL)
                 }
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  4: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  5: getPMOptNextMap()
  6: getPMOption("nextmap")
  7: getOption(sprintf("parallelMap.%s", opt), def)
  
  ── 37. Error: tuneModel tunes (@test.tune.R#4)  ────────────────────────────────
  argument "def" is missing, with no default
  1: tuneModel(d, classify, testclassifier, design, misclassificationPenalties, nfolds = 2L, 
         quiet = TRUE) at testthat/test.tune.R:4
  2: lapply(1:n.outer.folds, function(i) {
         if (!quiet) 
             message(paste("Fold ", i, "/", n.outer.folds, ":", sep = ""))
         ldf2 = ldf
         ldf2$data = ldf$data[ldf$train[[i]], ]
         ldf3 = ldf2
         ldf3 = cvFolds(ldf3, nfolds = nfolds)
         best.parvals = tuneLlamaModel(ldf3, llama.fun, learner, design, metric, quiet)
         outer.split.ldf = ldf
         outer.split.ldf$train = list(ldf$train[[i]])
         outer.split.ldf$test = list(ldf$test[[i]])
         learner2 = setHyperPars(learner, par.vals = best.parvals)
         model = llama.fun(learner2, data = outer.split.ldf)
         retval = model$predictions
         retval$iteration = i
         return(list(predictions = retval, parvals = best.parvals))
     })
  3: FUN(X[[i]], ...)
  4: tuneLlamaModel(ldf3, llama.fun, learner, design, metric, quiet)
  5: parallelMap(function(x) {
         pars = as.list(design[x, , drop = FALSE])
         learner = setHyperPars(learner, par.vals = pars)
         model = llama.fun(learner, ldf)
         score = mean(metric(ldf, model))
         if (!quiet) 
             message(paste("      [", paste(names(pars), pars, sep = " = ", collapse = ", "), 
                 "], score = ", score, sep = ""))
         return(score)
     }, 1:nrow(design), simplify = TRUE, level = "llama.tune")
  6: mapply(fun2, ..., MoreArgs = more.args, SIMPLIFY = FALSE, USE.NAMES = FALSE)
  7: (function (x) 
     {
         pars = as.list(design[x, , drop = FALSE])
         learner = setHyperPars(learner, par.vals = pars)
         model = llama.fun(learner, ldf)
         score = mean(metric(ldf, model))
         if (!quiet) 
             message(paste("      [", paste(names(pars), pars, sep = " = ", collapse = ", "), 
                 "], score = ", score, sep = ""))
         return(score)
     })(dots[[1L]][[1L]])
  8: llama.fun(learner, ldf)
  9: rbind.fill(parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold"))
  10: parallelMap(function(i) {
         trf = pre(data$data[data$train[[i]], ][data$features])
         tsf = pre(data$data[data$test[[i]], ][data$features], trf$meta)
         ids = data$data[data$test[[i]], ][data$ids]
         trp = data$data[data$train[[i]], ][data$performance]
         trw = abs(apply(trp, 1, max) - apply(trp, 1, min))
         trainpredictions = list()
         ensemblepredictions = list()
         trainBests = data.frame(target = factor(breakBestTies(data, i), levels = data$performance))
         for (j in 1:length(classifier)) {
             if (hasLearnerProperties(classifier[[j]], "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features))
             }
             if (length(unique(trainBests$target)) == 1) {
                 model = train(constantClassifier, task = task)
             }
             else {
                 model = train(classifier[[j]], task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = model, train.data = task, test.data = tsf$features), 
                     file = paste(save.models, classifier[[j]]$id, i, "rds", sep = "."))
             }
             if (inherits(combinator, "Learner")) {
                 preds = predict(model, newdata = trf$features)
                 trainpredictions[[j]] = if (preds$predict.type == "prob") {
                     getPredictionProbabilities(preds, data$performance)
                 }
                 else {
                     tmp = getPredictionResponse(preds)
                     rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                       levels(tmp)), levels(tmp))))))
                 }
             }
             preds = predict(model, newdata = tsf$features)
             ensemblepredictions[[j]] = if (preds$predict.type == "prob") {
                 getPredictionProbabilities(preds, data$performance)
             }
             else {
                 tmp = getPredictionResponse(preds)
                 rbind.fill(lapply(tmp, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(tmp)), levels(tmp))))))
             }
         }
         if (inherits(combinator, "Learner")) {
             if (hasLearnerProperties(combinator, "weights") && use.weights) {
                 task = makeClassifTask(id = "classify", target = "target", weights = trw, 
                     data = data.frame(trainBests, trf$features, trainpredictions))
             }
             else {
                 task = makeClassifTask(id = "classify", target = "target", data = data.frame(trainBests, 
                     trf$features, trainpredictions))
             }
             if (length(unique(trainBests$target)) == 1) {
                 combinedmodel = train(constantClassifier, task = task)
             }
             else {
                 combinedmodel = train(combinator, task = task)
             }
             if (!is.na(save.models)) {
                 saveRDS(list(model = combinedmodel, train.data = task, test.data = data.frame(tsf$features, 
                     ensemblepredictions)), file = paste(save.models, combinator$id, "combined", 
                     i, "rds", sep = "."))
             }
             preds = predict(combinedmodel, newdata = data.frame(tsf$features, ensemblepredictions))
             if (preds$predict.type == "prob") {
                 preds = getPredictionProbabilities(preds, data$performance)
             }
             else {
                 preds = getPredictionResponse(preds)
                 preds = rbind.fill(lapply(preds, function(x) data.frame(t(setNames(as.numeric(x == 
                     levels(preds)), levels(preds))))))
             }
             combinedpredictions = rbind.fill(lapply(1:nrow(preds), function(j) {
                 ss = preds[j, , drop = F]
                 ord = order(ss, decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(ss)[ord], score = as.numeric(ss)[ord], 
                     iteration = i, row.names = NULL)
             }))
         }
         else {
             merged = Reduce("+", ensemblepredictions)
             combinedpredictions = rbind.fill(lapply(1:nrow(merged), function(j) {
                 ord = order(merged[j, ], decreasing = TRUE)
                 data.frame(ids[j, , drop = F], algorithm = names(merged)[ord], score = as.numeric(merged[j, 
                     ])[ord], iteration = i, row.names = NULL)
             }))
         }
         return(combinedpredictions)
     }, 1:length(data$train), level = "llama.fold")
  11: options(parallelMap.nextmap = (getPMOptNextMap() + 1L))
  12: getPMOptNextMap()
  13: getPMOption("nextmap")
  14: getOption(sprintf("parallelMap.%s", opt), def)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 468 SKIPPED: 10 FAILED: 37
  1. Error: classify classifies (@test.classify.R#2) 
  2. Error: classify returns predictor (@test.classify.R#11) 
  3. Error: classify returns predictor that works without IDs (@test.classify.R#22) 
  4. Error: classify takes list of classifiers (@test.classify.R#45) 
  5. Error: classify takes list of classifiers and combination function (@test.classify.R#62) 
  6. Error: classify ensemble does majority voting by default (@test.classify.R#79) 
  7. Error: classify works with NA predictions (@test.classify.R#96) 
  8. Error: classify works with probabilities (@test.classify.R#158) 
  9. Error: classifyPairs classifies (@test.classifyPairs.R#2) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted