Skip to content

Commit

Permalink
Merge pull request #865 from mlr-org/fix_blsmote_test
Browse files Browse the repository at this point in the history
Fix: Add `set.seed()` in BLSmote tests
  • Loading branch information
advieser authored Jan 18, 2025
2 parents e736e76 + 4894e33 commit f8e8bc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* New parameter `new_role_direct` for `PipeOpColRoles` / `po("colroles")` to change column roles by role instead of by column.
* Dictionary sugar functions `po()` / `pos()` / `ppl()` / `ppls()` now make suggestions for entries in both `mlr_pipeops` as well as `mlr_graphs` when an object by the given name could not be found in the respective dictionary.
* New PipeOp `PipeOpDecode` / `po("decode")` to reverse one-hot or treatment encoding.
* Fix: Made tests for `PipeOpBLSmote` deterministic.

# mlr3pipelines 0.7.1

Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test_pipeop_blsmote.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ test_that("PipeOpBLSmote - train works as intended", {

op = PipeOpBLSmote$new()

set.seed(1234)
df = smotefamily::sample_generator(500, 0.8)
df$result = factor(df$result)
df = df[, c(3L, 1L, 2L)] # we do this to avoid reordering later
Expand Down Expand Up @@ -75,6 +76,7 @@ test_that("PipeOpBLSmote - handling of feature named 'class'", {

op = PipeOpBLSmote$new()

set.seed(1234)
df = smotefamily::sample_generator(500, 0.8)
df$result = factor(df$result)
# Rename a column into "class"
Expand Down

0 comments on commit f8e8bc0

Please sign in to comment.