From 1742b46bca1349ef018e662517b42343f9bd038a Mon Sep 17 00:00:00 2001 From: Marc Becker <33069354+be-marc@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:03:17 +0100 Subject: [PATCH] release: 1.3.0 (#483) * release: 1.3.0 * ... * ... * ... * ... --- DESCRIPTION | 8 +++----- NEWS.md | 5 +++-- R/ArchiveAsyncTuningFrozen.R | 2 +- R/TunerBatchIrace.R | 4 ++-- R/mlr_callbacks.R | 2 +- man/ArchiveAsyncTuningFrozen.Rd | 2 +- man/mlr3tuning.async_freeze_archive.Rd | 2 +- man/mlr_tuners_irace.Rd | 4 ++-- tests/testthat/test_TunerBatchIrace.R | 7 +------ 9 files changed, 15 insertions(+), 21 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 27ee3c28..f038eb90 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: mlr3tuning Title: Hyperparameter Optimization for 'mlr3' -Version: 1.2.1.9000 +Version: 1.3.0 Authors@R: c( person("Marc", "Becker", , "marcbecker@posteo.de", role = c("cre", "aut"), comment = c(ORCID = "0000-0002-8115-0400")), @@ -29,7 +29,7 @@ Depends: paradox (>= 1.0.1), R (>= 3.1.0) Imports: - bbotk (>= 1.4.1), + bbotk (>= 1.5.0), checkmate (>= 2.0.0), data.table, lgr, @@ -39,7 +39,7 @@ Suggests: adagio, future, GenSA, - irace (>= 4.0.0), + irace (>= 4.1.0), knitr, mlflow, mlr3learners (>= 0.7.0), @@ -50,8 +50,6 @@ Suggests: rpart, testthat (>= 3.0.0), xgboost -Remotes: - mlr-org/bbotk VignetteBuilder: knitr Config/testthat/edition: 3 diff --git a/NEWS.md b/NEWS.md index d1961025..737e4249 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ -# mlr3tuning (development version) +# mlr3tuning 1.3.0 -perf: save models on worker only when requested in `ObjectiveTuningAsync`. +* feat: Save `ArchiveAsyncTuning` to a `data.table` with `ArchiveAsyncTuningFrozen`. +* perf: Save models on worker only when requested in `ObjectiveTuningAsync`. # mlr3tuning 1.2.1 diff --git a/R/ArchiveAsyncTuningFrozen.R b/R/ArchiveAsyncTuningFrozen.R index 09ddc1ab..c141b5f6 100644 --- a/R/ArchiveAsyncTuningFrozen.R +++ b/R/ArchiveAsyncTuningFrozen.R @@ -8,7 +8,7 @@ #' #' @section S3 Methods: #' * `as.data.table(archive)`\cr -#' [ArchiveAsync] -> [data.table::data.table()]\cr +#' [ArchiveAsyncTuningFrozen] -> [data.table::data.table()]\cr #' Returns a tabular view of all performed function calls of the Objective. #' The `x_domain` column is unnested to separate columns. #' diff --git a/R/TunerBatchIrace.R b/R/TunerBatchIrace.R index 7e06e603..8b3fab88 100644 --- a/R/TunerBatchIrace.R +++ b/R/TunerBatchIrace.R @@ -54,8 +54,8 @@ #' # load learner and set search space #' learner = lrn("classif.rpart", cp = to_tune(1e-04, 1e-1, logscale = TRUE)) #' -#' # currently there is bug in irace 4.0.0 that sometimes let the example crash -#' \dontrun{ +#' # runtime of the example is too long +#' \donttest{ #' # hyperparameter tuning on the pima indians diabetes data set #' instance = tune( #' tuner = tnr("irace"), diff --git a/R/mlr_callbacks.R b/R/mlr_callbacks.R index 69f120e4..2ff80949 100644 --- a/R/mlr_callbacks.R +++ b/R/mlr_callbacks.R @@ -433,7 +433,7 @@ load_callback_one_se_rule = function() { #' @name mlr3tuning.async_freeze_archive #' #' @description -#' This [CallbackAsync] freezes the [ArchiveAsync] to [ArchiveAsyncFrozen] after the optimization has finished. +#' This [CallbackAsyncTuning] freezes the [ArchiveAsyncTuning] to [ArchiveAsyncTuningFrozen] after the optimization has finished. #' #' @examples #' clbk("mlr3tuning.async_freeze_archive") diff --git a/man/ArchiveAsyncTuningFrozen.Rd b/man/ArchiveAsyncTuningFrozen.Rd index 89a86036..c04e14cd 100644 --- a/man/ArchiveAsyncTuningFrozen.Rd +++ b/man/ArchiveAsyncTuningFrozen.Rd @@ -13,7 +13,7 @@ Use the callback \link{mlr3tuning.async_freeze_archive} to freeze the archive af \itemize{ \item \code{as.data.table(archive)}\cr -\link{ArchiveAsync} -> \code{\link[data.table:data.table]{data.table::data.table()}}\cr +\link{ArchiveAsyncTuningFrozen} -> \code{\link[data.table:data.table]{data.table::data.table()}}\cr Returns a tabular view of all performed function calls of the Objective. The \code{x_domain} column is unnested to separate columns. } diff --git a/man/mlr3tuning.async_freeze_archive.Rd b/man/mlr3tuning.async_freeze_archive.Rd index 3654dc51..972f2e1b 100644 --- a/man/mlr3tuning.async_freeze_archive.Rd +++ b/man/mlr3tuning.async_freeze_archive.Rd @@ -4,7 +4,7 @@ \alias{mlr3tuning.async_freeze_archive} \title{Freeze Archive Callback} \description{ -This \link{CallbackAsync} freezes the \link{ArchiveAsync} to \link{ArchiveAsyncFrozen} after the optimization has finished. +This \link{CallbackAsyncTuning} freezes the \link{ArchiveAsyncTuning} to \link{ArchiveAsyncTuningFrozen} after the optimization has finished. } \examples{ clbk("mlr3tuning.async_freeze_archive") diff --git a/man/mlr_tuners_irace.Rd b/man/mlr_tuners_irace.Rd index cf1d290e..65bcf2f7 100644 --- a/man/mlr_tuners_irace.Rd +++ b/man/mlr_tuners_irace.Rd @@ -109,8 +109,8 @@ task = tsk("pima") # load learner and set search space learner = lrn("classif.rpart", cp = to_tune(1e-04, 1e-1, logscale = TRUE)) -# currently there is bug in irace 4.0.0 that sometimes let the example crash -\dontrun{ +# runtime of the example is too long +\donttest{ # hyperparameter tuning on the pima indians diabetes data set instance = tune( tuner = tnr("irace"), diff --git a/tests/testthat/test_TunerBatchIrace.R b/tests/testthat/test_TunerBatchIrace.R index 39a6887d..f14ca37c 100644 --- a/tests/testthat/test_TunerBatchIrace.R +++ b/tests/testthat/test_TunerBatchIrace.R @@ -1,7 +1,6 @@ skip_if_not_installed("irace") test_that("TunerIrace", { - skip_if(TRUE) # Remove this line when irace is fixed z = test_tuner("irace", term_evals = 42) instance = z$inst archive = instance$archive$data @@ -23,7 +22,6 @@ test_that("TunerIrace", { }) test_that("TunerIrace works with dependencies", { - skip_if(TRUE) # Remove this line when irace is fixed search_space = ps( cp = p_dbl(lower = 0.001, upper = 0.1), minsplit = p_int(lower = 1, upper = 10, depends = cp == 0.005) @@ -44,7 +42,6 @@ test_that("TunerIrace works with dependencies", { }) test_that("TunerIrace works with logical parameters", { - skip_if(TRUE) # Remove this line when irace is fixed search_space = ps( cp = p_dbl(lower = 0.001, upper = 0.1), keep_model = p_lgl()) @@ -61,9 +58,8 @@ test_that("TunerIrace works with logical parameters", { }) test_that("TunerIrace uses digits", { - skip_if(TRUE) # Remove this line when irace is fixed search_space = ps(cp = p_dbl(lower = pi * 1e-20, upper = 5.242e12 / 1e13)) - instance = ti( + instance = ti( task = tsk("mtcars"), learner = lrn("regr.rpart"), resampling = rsmp("holdout"), @@ -75,7 +71,6 @@ test_that("TunerIrace uses digits", { }) test_that("TunerIrace works with unnamed discrete values", { - skip_if(TRUE) # Remove this line when irace is fixed # we had a bug here, see (mlr) issue #627 search_space = ps(minsplit = p_int(lower = 2L, upper = 7L)) instance = ti(