diff --git a/tests/testthat/test-errorProfiles.R b/tests/testthat/test-errorProfiles.R index 8dcebdf4..dcf0fdf6 100644 --- a/tests/testthat/test-errorProfiles.R +++ b/tests/testthat/test-errorProfiles.R @@ -8,7 +8,7 @@ test_that("errorProfiles works in default settings", { model <- caret::train(splotdata[,6:16], splotdata$Species_richness, ntree = 10, trControl = caret::trainControl(method = "cv", savePredictions = TRUE)) - AOA <- CAST::aoa(predictors, model) + AOA <- CAST::aoa(predictors, model,verbose=F) # DI ~ error errormodel_DI <- CAST::errorProfiles(model, AOA, variable = "DI") @@ -37,7 +37,7 @@ test_that("errorProfiles works in with LPD", { model <- caret::train(splotdata[,6:16], splotdata$Species_richness, ntree = 10, trControl = caret::trainControl(method = "cv", savePredictions = TRUE)) - AOA <- CAST::aoa(predictors, model, LPD = TRUE, maxLPD = 1) + AOA <- CAST::aoa(predictors, model, LPD = TRUE, maxLPD = 1,verbose=F) errormodel_LPD <- CAST::errorProfiles(model, AOA, variable = "LPD") expected_error_LPD = terra::predict(AOA$LPD, errormodel_LPD) @@ -64,7 +64,7 @@ test_that("errorProfiles works for multiCV", { model <- caret::train(splotdata[,6:16], splotdata$Species_richness, ntree = 10, trControl = caret::trainControl(method = "cv", savePredictions = TRUE)) - AOA <- CAST::aoa(predictors, model) + AOA <- CAST::aoa(predictors, model,verbose=F) # with multiCV = TRUE (for DI ~ error) set.seed(100) errormodel_DI = suppressWarnings(errorProfiles(model, AOA, multiCV = TRUE, length.out = 3)) diff --git a/tests/testthat/test-fss.R b/tests/testthat/test-fss.R index 70001fc0..05d78346 100644 --- a/tests/testthat/test-fss.R +++ b/tests/testthat/test-fss.R @@ -97,7 +97,8 @@ test_that("ffs works with default arguments and the iris dataset",{ seed = 1) expect_identical(selection$selectedvars, c("Petal.Length", "Petal.Width", "Sepal.Width")) - expect_equal(selection$selectedvars_perf, c(0.9530141, 0.9544820, 0.9544820)) + expect_equal(selection$selectedvars_perf, c(0.9530141, 0.9544820, 0.9544820), + tolerance = 0.005) }) @@ -128,7 +129,7 @@ test_that("ffs works with withinSE = TRUE", { expect_identical(selection$selectedvars, c("Petal.Length", "Petal.Width")) - expect_equal(selection$selectedvars_perf, c(0.9530141), tolerance = 0.0005) + expect_equal(selection$selectedvars_perf, c(0.9530141), tolerance = 0.005) })