data(mtcars)
# A balanced model with default half of smallest class size
sampsize_0.5 <- balancedSampsize(mtcars$am)
sampsize_0.5
rfPermute(factor(am) ~ ., mtcars, replace = FALSE, sampsize = sampsize_0.5)
# A balanced model with one quarter of smallest class size
sampsize_0.25 <- balancedSampsize(mtcars$am, pct = 0.25)
sampsize_0.25
rfPermute(factor(am) ~ ., mtcars, replace = FALSE, sampsize = sampsize_0.25)
Run the code above in your browser using DataLab