Skip to content

Commit

Permalink
added seed
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo committed Nov 25, 2024
1 parent b9d6b9c commit 019b0a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/caret/tests/testthat/test_Dummies.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ check_dummies <- function(x, expected = NULL) {
expect_equal(exp_names, res_names)

foosbarsbars <- dummies <- dummyVars(formula = id ~.,
data = test_data,
sep = '-',
levelsOnly = TRUE)
data = test_data,
sep = '-',
levelsOnly = TRUE)

exp_names_lvls <- paste(1:9)
res_names_lvls <- colnames(predict(foosbarsbars, test_data))
Expand All @@ -120,6 +120,7 @@ check_dummies <- function(x, expected = NULL) {


test_that("Good names for dummies with reocurring patterns", {
set.seed(1)
# 200 all but guarantees (99.999% chance) 1:15 all represented, #1350
data = data.frame(
matrix(
Expand Down

0 comments on commit 019b0a1

Please sign in to comment.