Skip to content

Commit

Permalink
remove unneeded tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebffischer committed Aug 21, 2024
1 parent 2110ceb commit f7708af
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
18 changes: 0 additions & 18 deletions tests/testthat/test_LearnerTorch.R
Original file line number Diff line number Diff line change
Expand Up @@ -457,24 +457,6 @@ test_that("Input verification works during `$train()` (train-predict shapes work
expect_true(nrow(rr2$errors) == 0L)
})

test_that("Input verification works during `$predict()` (same column info, problematic fct -> int conversion)", {
task1 = as_task_classif(data.table(
y = factor(c("A", "B"))
), target = "y", id = "test1")

task2 = as_task_classif(data.table(
y = factor(c("A", "B"), labels = c("B", "A"), levels = c("B", "A"))
), target = "y", id = "test2")

learner = lrn("classif.torch_featureless", batch_size = 1L, epochs = 0L)

learner$train(task1)
expect_error(
learner$predict(task2),
"does not match"
)
})

test_that("col_info is propertly subset when comparing task validity during predict", {
task = tsk("iris")$select("Sepal.Length")
learner = classif_mlp2()
Expand Down
11 changes: 0 additions & 11 deletions tests/testthat/test_learner_torch_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,3 @@ test_that("learner_torch_dataloader_predict works", {
expect_false(dl$drop_last)
expect_class(dl$batch_sampler$sampler, "utils_sampler_sequential")
})

test_that("wrong column info stops learner from prediction.", {
d1 = data.table(x = 1:10, y = 1:10)
d2 = data.table(x = runif(10), y = 1:10)
t1 = as_task_regr(d1, target = "y")
t2 = as_task_regr(d2, target = "y")

learner = lrn("regr.torch_featureless", epochs = 1, batch_size = 50)
learner$train(t1)
expect_error(learner$predict(t2))
})

0 comments on commit f7708af

Please sign in to comment.