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

V0.3.1 #547

Merged
merged 4 commits into from Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESCRIPTION
@@ -1,6 +1,6 @@
Package: mlr3pipelines
Title: Preprocessing Operators and Pipelines for 'mlr3'
Version: 0.3.0-9000
Version: 0.3.1
Authors@R:
c(person(given = "Martin",
family = "Binder",
Expand Down Expand Up @@ -82,10 +82,11 @@ Suggests:
methods,
vtreat
Remotes:
mlr-org/mlr3,
Bioconductor/Biobase
ByteCompile: true
Encoding: UTF-8
Config/testthat/edition: 3
Config/testthat/parallel: true
LazyData: true
NeedsCompilation: no
Roxygen: list(markdown = TRUE, r6 = FALSE)
Expand Down
8 changes: 7 additions & 1 deletion NEWS.md
@@ -1,4 +1,4 @@
# mlr3pipelines 0.3.0-9000
# mlr3pipelines 0.3.1

* Changed PipeOps:
- PipeOpMissInd now also allows for setting type = integer
Expand All @@ -8,6 +8,12 @@
- fix how pipeline_robustify determines the type of newly created columns when using PipeOpMissInd
- PipeOpFeatureUnion: Fixed a minor bug when checking for duplicates
* added an autotest for ParamSets of PipeOps: expect_valid_pipeop_param_set
* More informative error message when PipeOp input value has wrong type
* Fix automatic detection of R6 type hierarchy
* Performance improvements for GraphLearner
* GraphLearner allows custom id
* Use parallel tests
* Removed bibtex dependency

# mlr3pipelines 0.3.0

Expand Down
12 changes: 12 additions & 0 deletions tests/testthat/helper_compat.R
@@ -0,0 +1,12 @@

# compatibility to with broken testthat v3 behaviour
expect_equal = function(object, expected, ..., info = NULL, label = NULL) {
expect_true(all.equal(object, expected, ...), info = info, label = label)
}

# suppress warnings as long as half the world still uses v2
context = function(...) suppressWarnings(testthat::context(...))
expect_is = function(...) suppressWarnings(testthat::expect_is(...))
expect_equivalent = function(...) suppressWarnings(testthat::expect_equivalent(...))

library("checkmate")
4 changes: 2 additions & 2 deletions tests/testthat/test_pipeop_encodeimpact.R
Expand Up @@ -61,11 +61,11 @@ test_that("PipeOpImpactEncode on Classification", {

op$param_set$values$smoothing = 1e-4
op$train(list(testtask))
expect_equal(mean(abs(op$state$impact$a - expm), na.rm = TRUE), 0.5e-4)
expect_equal(mean(abs(op$state$impact$a - expm), na.rm = TRUE), 1e-4 / 2 - 1e-4^2 * 3 / 8)

op$param_set$values$smoothing = 1e-8
op$train(list(testtask))
expect_equal(mean(abs(op$state$impact$a - expm), na.rm = TRUE) * 1e4, 0.5e-4)
expect_equal(mean(abs(op$state$impact$a - expm), na.rm = TRUE), 0) # equal to 0 within tolerance

op$param_set$values$smoothing = 6.362e-9 # similar to what glm uses
encoded = op$train(list(testtask))[[1]]$data()
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_pipeop_textvectorizer.R
Expand Up @@ -269,6 +269,6 @@ test_that("PipeOpTextVectorizer - factor sequence", {
op = PipeOpTextVectorizer$new(param_vals = list(stopwords_language = "none", return_type = "factor_sequence", sequence_length = 4L))
result = op$train(list(task$clone()$filter(2:3)))[[1]]
prd = op$predict(list(task$clone()$filter(rows = 1L)))[[1]]
expect_true(all(is.na(prd$data()[, paste0("txt.V", 1:4)])))
expect_true(all(is.na(prd$data()[, paste0("txt.V", 1:4)])), info = paste(capture.output(print(prd$data())), collapse = "\n"))
expect_true(prd$nrow == 1L)
})