Skip to content

Commit

Permalink
Merge pull request #844 from mlr-org/dev-compatibility
Browse files Browse the repository at this point in the history
make sure dev-version of mlr3 is compatible
  • Loading branch information
mb706 authored Nov 15, 2024
2 parents 0b88eec + 4df414e commit 1566ae6
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev-cmd-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -197,6 +197,7 @@ Collate:
'PipeOpVtreat.R'
'PipeOpYeoJohnson.R'
'Selector.R'
'TaskRegr_boston_housing.R'
'assert_graph.R'
'bibentries.R'
'greplicate.R'
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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)`
Expand Down
25 changes: 25 additions & 0 deletions R/TaskRegr_boston_housing.R
Original file line number Diff line number Diff line change
@@ -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)
}
10 changes: 9 additions & 1 deletion R/bibentries.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
1 change: 1 addition & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions man/mlr_tasks_boston_housing.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ reference:
contents:
- mlr_learners_graph
- mlr_learners_avg
- title: Tasks
contents:
- mlr_tasks_boston_housing
- title: Helpers
contents:
- Selector
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test_GraphLearner.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(...) {
Expand Down

0 comments on commit 1566ae6

Please sign in to comment.