Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more internal measure unit tests #19

Open
be-marc opened this issue Sep 13, 2024 · 0 comments · May be fixed by #23
Open

Add more internal measure unit tests #19

be-marc opened this issue Sep 13, 2024 · 0 comments · May be fixed by #23
Assignees

Comments

@be-marc
Copy link
Member

be-marc commented Sep 13, 2024

Write more unit tests that check the *_internal_measure() functions for catboost, lightgbm and xgboost. See

test_that("internal eval metric is found", {
skip_on_cran()
skip_if_not_installed("rush")
flush_redis()
rush_plan(n_workers = 2)
task = tsk("penguins")
learner = lrn("classif.auto_catboost",
small_data_size = 1,
resampling = rsmp("holdout"),
measure = msr("classif.ce"),
terminator = trm("evals", n_evals = 6),
store_benchmark_result = TRUE,
store_models = TRUE
)
learner$train(task)
expect_equal(learner$instance$archive$benchmark_result$resample_result(1)$learners[[1]]$model$catboost$param_vals$eval_metric, "Accuracy")
learner = lrn("classif.auto_catboost",
small_data_size = 1,
resampling = rsmp("holdout"),
measure = msr("classif.mbrier"),
terminator = trm("evals", n_evals = 6),
store_benchmark_result = TRUE,
store_models = TRUE
)
expect_error(learner$train(task), "No suitable catboost eval metric found")
})
and https://github.com/mlr-org/mlr3automl/blob/main/R/internal_measure.R

@b-zhou b-zhou linked a pull request Oct 4, 2024 that will close this issue
@b-zhou b-zhou linked a pull request Oct 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants