Description Usage Arguments Value Author(s) See Also Examples
Performs bootstrap sampling of our (training) dataset; this function is used
inside of the forestRK
function.
1 | bstrap(dat = data.frame(), nbags, samp.size)
|
dat |
a numericized data frame that stores both the covariates of the observations
and their numericized class types |
nbags |
the number of bags or the number of bootstrap samples that we want to generate. |
samp.size |
the number of samples that each bag (individual bootstrap sample) should contain. |
A list containing a data frames of bootstrap samples generated from dat
.
Hyunjin Cho, h56cho@uwaterloo.ca Rebecca Su, y57su@uwaterloo.ca
1 2 3 4 5 6 7 8 9 10 11 12 | ## example: iris dataset
## load the forestRK package
library(forestRK)
# covariates of training data set
x.train <- x.organizer(iris[,1:4], encoding = "num")[c(1:25,51:75,101:125),]
y.train <- y.organizer(iris[c(1:25,51:75,101:125),5])$y.new
# combine the covariates x with class types y
b <- data.frame(cbind(x.train, y.train))
## bstrp function example
bootstrap.sample <- bstrap(dat = b, nbags = 20, samp.size = 30)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.