From a5a58f5e6b0229c3a4cc2a201a729ef9f6e99745 Mon Sep 17 00:00:00 2001 From: Michel Lang Date: Fri, 16 Jun 2023 12:43:59 +0200 Subject: [PATCH] tests: try to fix stochastic error --- tests/testthat/test_mlr_learners_classif_featureless.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test_mlr_learners_classif_featureless.R b/tests/testthat/test_mlr_learners_classif_featureless.R index b7a1a70a7..9a14c1255 100644 --- a/tests/testthat/test_mlr_learners_classif_featureless.R +++ b/tests/testthat/test_mlr_learners_classif_featureless.R @@ -10,14 +10,14 @@ test_that("Simple training/predict", { learner = lrn("classif.featureless") expect_learner(learner, task) - learner$train(task) + learner$train(task, row_ids = c(1:50, 51:70, 101:120)) learner$predict(task) expect_class(learner$model, "classif.featureless_model") expect_numeric(learner$model$tab, len = 3L, any.missing = FALSE) prediction = learner$predict(task) expect_factor(prediction$response, any.missing = FALSE, levels = levels(iris$Species)) perf = prediction$score(msr("classif.ce")) - expect_number(perf, lower = 0.6, upper = 0.8) + expect_number(perf, lower = 0.6, upper = 0.7) }) test_that("Predict with prob", {