resample_partition | R Documentation |
Generate an exclusive partitioning of a data frame
resample_partition(data, p)
data |
A data frame |
p |
A named numeric vector giving where the value is the probability that an observation will be assigned to that group. |
Other resampling techniques:
bootstrap()
,
resample_bootstrap()
,
resample()
ex <- resample_partition(mtcars, c(test = 0.3, train = 0.7))
mod <- lm(mpg ~ wt, data = ex$train)
rmse(mod, ex$test)
rmse(mod, ex$train)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.