-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# this test / files was missing, only classif.debug was unit-tested | ||
# I added at least a few basic tests when i added methods "importance" and "selected_features" | ||
|
||
test_that("Simple training/predict", { | ||
task = tsk("mtcars") | ||
learner = lrn("regr.debug") | ||
expect_learner(learner, task) | ||
|
||
prediction = learner$train(task)$predict(task) | ||
expect_class(learner$model, "regr.debug_model") | ||
expect_numeric(learner$model$response, len = 1L, any.missing = FALSE) | ||
expect_numeric(prediction$response, any.missing = FALSE) | ||
}) | ||
|
||
|
||
test_that("importance and selected features", { | ||
l = lrn("regr.debug") | ||
task = tsk("mtcars") | ||
l$train(task) | ||
expect_equal(l$selected_features(), character(0)) | ||
expect_equal(l$importance(), set_names(rep(0, task$n_features), task$feature_names)) | ||
}) | ||
|
||
|
||
|