Skip to content

Commit

Permalink
chore: update rpf paramtests to current template
Browse files Browse the repository at this point in the history
  • Loading branch information
jemus42 committed Oct 18, 2023
1 parent 86ad7f0 commit c18b671
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("classif.rpf train", {
learner = lrn("classif.rpf")
fun.list = list(randomPlantedForest:::rpf.data.frame)
fun = randomPlantedForest:::rpf.data.frame
exclude = c(
"x", "y", # handled internally
"max_interaction_ratio",
Expand All @@ -9,20 +9,20 @@ test_that("classif.rpf train", {

# note that you can also pass a list of functions in case $.train calls more than one
# function, e.g. for control arguments
paramtest = run_paramtest(learner, fun.list, exclude, tag = "train")
paramtest = run_paramtest(learner, fun, exclude, tag = "train")
expect_paramtest(paramtest)
})

test_that("classif.rpf predict", {
learner = lrn("classif.rpf")
fun.list = list(predict) # nolint
fun = predict # nolint
exclude = c(
"object", # handled internally
"data", # handled internally
"new_data", # handled internally
"type" # Not sure but handled by predict_type?
)

paramtest = run_paramtest(learner, fun.list, exclude, tag = "predict")
paramtest = run_paramtest(learner, fun, exclude, tag = "predict")
expect_paramtest(paramtest)
})
8 changes: 4 additions & 4 deletions tests/testthat/test_paramtest_randomPlantedForest_regr_rpf.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("regr.rpf train", {
learner = lrn("regr.rpf")
fun.list = list(randomPlantedForest:::rpf.data.frame)
fun = randomPlantedForest:::rpf.data.frame
exclude = c(
"x", "y", # handled internally
"loss", # Not applicable for regression learner
Expand All @@ -12,20 +12,20 @@ test_that("regr.rpf train", {

# note that you can also pass a list of functions in case $.train calls more than one
# function, e.g. for control arguments
paramtest = run_paramtest(learner, fun.list, exclude, tag = "train")
paramtest = run_paramtest(learner, fun, exclude, tag = "train")
expect_paramtest(paramtest)
})

test_that("regr.rpf predict", {
learner = lrn("regr.rpf")
fun.list = list(predict) # nolint
fun = predict # nolint
exclude = c(
"object", # handled internally
"data", # handled internally
"new_data", # handled internally
"type" # Not sure but handled by predict_type?
)

paramtest = run_paramtest(learner, fun.list, exclude, tag = "predict")
paramtest = run_paramtest(learner, fun, exclude, tag = "predict")
expect_paramtest(paramtest)
})

0 comments on commit c18b671

Please sign in to comment.