Skip to content

Commit

Permalink
add set.seed() for smotefamily::sample_generator()
Browse files Browse the repository at this point in the history
  • Loading branch information
advieser committed Jan 13, 2025
1 parent b1042d7 commit a447256
Showing 1 changed file with 2 additions and 0 deletions.
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 a447256

Please sign in to comment.