diff --git a/.github/workflows/dev-cmd-check.yml b/.github/workflows/dev-cmd-check.yml index 77e4a431e..cddab1c1a 100644 --- a/.github/workflows/dev-cmd-check.yml +++ b/.github/workflows/dev-cmd-check.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: config: - - {os: ubuntu-latest, r: 'release', dev-package: "mlr-org/bbotk', 'mlr-org/mlr3learners', 'mlr-org/paradox"} + - {os: ubuntu-latest, r: 'release', dev-package: "mlr-org/mlr3', 'mlr-org/bbotk', 'mlr-org/mlr3learners', 'mlr-org/paradox"} steps: - uses: actions/checkout@v4 diff --git a/DESCRIPTION b/DESCRIPTION index c89039e39..513f4fc27 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: mlr3pipelines Title: Preprocessing Operators and Pipelines for 'mlr3' -Version: 0.7.0-9000 +Version: 0.7.1 Authors@R: c(person(given = "Martin", family = "Binder", @@ -197,6 +197,7 @@ Collate: 'PipeOpVtreat.R' 'PipeOpYeoJohnson.R' 'Selector.R' + 'TaskRegr_boston_housing.R' 'assert_graph.R' 'bibentries.R' 'greplicate.R' diff --git a/NEWS.md b/NEWS.md index b2339cfeb..63f634321 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ -# mlr3pipelines 0.7.0-9000 +# mlr3pipelines 0.7.1 +* Compatibility fix for upcoming `mlr3` * New down-sampling PipeOps for inbalanced data: `PipeOpTomek` / `po("tomek")` and `PipeOpNearmiss` / `po("nearmiss")` * New PipeOp `PipeOpLearnerPICVPlus / po("learner_pi_cvplus")` * New PipeOp for Quantile Regression `PipeOpLearnerQuantiles` / `po(learner_quantiles)` diff --git a/R/TaskRegr_boston_housing.R b/R/TaskRegr_boston_housing.R new file mode 100644 index 000000000..b0a13b3e5 --- /dev/null +++ b/R/TaskRegr_boston_housing.R @@ -0,0 +1,25 @@ +#' @title Housing Data for 506 Census Tracts of Boston +#' +#' @usage NULL +#' @name mlr_tasks_boston_housing +#' @format [`R6Class`][R6::R6Class] object inheriting from [`TaskRegr`][mlr3::TaskRegr]. +#' +#' The [`BostonHousing2`][mlbench::BostonHousing2] dataset +#' containing the corrected data from `r format_bib("freeman_1979")` +#' as provided by the `mlbench` package. See data description there. +#' +NULL + +load_boston_housing = function(id = "boston_housing") { + bh = mlr3misc::load_dataset("BostonHousing2", "mlbench") + bh$medv = NULL + bht = as_task_regr(bh, target = "cmedv", id = id, label = "Boston Housing Prices") + bht$man = "mlr3pipelines::mlr_tasks_boston_housing" + bht$backend$hash = "mlr3::mlr_tasks_boston_housing" + bht +} + +supply_boston_housing = function() { + if (tsk()$has("boston_housing")) return(invisible(NULL)) + tsk()$add("boston_housing", load_boston_housing) +} diff --git a/R/bibentries.R b/R/bibentries.R index dd2d7fa98..e6079539c 100644 --- a/R/bibentries.R +++ b/R/bibentries.R @@ -104,6 +104,14 @@ bibentries = c( address = "Berlin, Heidelberg", pages = "878--887", isbn = "978-3-540-31902-3" - ) + ), + freeman_1979 = bibentry("InCollection", + author = "Freeman III, A Myrick", + title = "The Hedonic Price Approach to Measuring Demand for Neighborhood Characteristics", + booktitle = "The Economics of Neighborhood", + year = "1979", + publisher = "Elsevier", + pages = "191--217" + ) ) diff --git a/R/zzz.R b/R/zzz.R index a4333c8a8..1e9995f19 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -31,6 +31,7 @@ paradox_info <- list2env(list(is_old = FALSE), parent = emptyenv()) lg$set_threshold("warn") } paradox_info$is_old = "set_id" %in% names(ps()) + supply_boston_housing() } # nocov end .onUnload = function(libpath) { # nocov start diff --git a/man/mlr_tasks_boston_housing.Rd b/man/mlr_tasks_boston_housing.Rd new file mode 100644 index 000000000..6e8e26a82 --- /dev/null +++ b/man/mlr_tasks_boston_housing.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/TaskRegr_boston_housing.R +\name{mlr_tasks_boston_housing} +\alias{mlr_tasks_boston_housing} +\title{Housing Data for 506 Census Tracts of Boston} +\format{ +\code{\link[R6:R6Class]{R6Class}} object inheriting from \code{\link[mlr3:TaskRegr]{TaskRegr}}. + +The \code{\link[mlbench:BostonHousing]{BostonHousing2}} dataset +containing the corrected data from III F, Myrick A (1979). +\dQuote{The Hedonic Price Approach to Measuring Demand for Neighborhood Characteristics.} +In \emph{The Economics of Neighborhood}, 191--217. +Elsevier. +as provided by the \code{mlbench} package. See data description there. +} +\description{ +Housing Data for 506 Census Tracts of Boston +} diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 726ab95b0..2c3122ce6 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -81,6 +81,9 @@ reference: contents: - mlr_learners_graph - mlr_learners_avg + - title: Tasks + contents: + - mlr_tasks_boston_housing - title: Helpers contents: - Selector diff --git a/tests/testthat/test_GraphLearner.R b/tests/testthat/test_GraphLearner.R index e4e93a6aa..38115e84a 100644 --- a/tests/testthat/test_GraphLearner.R +++ b/tests/testthat/test_GraphLearner.R @@ -1261,6 +1261,8 @@ test_that("GraphLearner Selected Features", { test_that("GraphLearner other properties", { + has_loglik = "loglik" %in% mlr_reflections$learner_properties[["classif"]] + if (!has_loglik) skip() DebugWithProperties = R6Class("DebugWithProperties", inherit = LearnerClassifDebug, public = list( initialize = function(...) {