
Randomize feature order to eliminate any position-dependent effects
Source:R/utils.R
randomize_feature_order.Rd
Randomize feature order to eliminate any position-dependent effects
Arguments
- dataset
Data frame with an outcome variable and other columns as features.
- outcome_colname
Column name as a string of the outcome variable (default
NULL
; the first column will be chosen automatically).
Examples
dat <- data.frame(
outcome = c("1", "2", "3"),
a = 4:6, b = 7:9, c = 10:12, d = 13:15
)
randomize_feature_order(dat, "outcome")
#> outcome c b a d
#> 1 1 10 7 4 13
#> 2 2 11 8 5 14
#> 3 3 12 9 6 15