Description Usage Arguments Value Author(s) Examples
The function base and returns a list of length k, to be used for k-fold cross validation sampling. Each element of the returned list is an array of random index for sampling for k-fold cross validation.
1 | fn_cross_index(base, k)
|
base |
input dataframe |
k |
number of cross validation |
The function a list of length k, each holding an array of index/row number for sampling the base.
Arya Poddar <aryapoddar290990@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 | data <- iris
data$Species <- as.character(data$Species)
suppressWarnings(RNGversion('3.5.0'))
set.seed(11)
data$Y <- sample(0:1,size=nrow(data),replace=TRUE)
data$Y_pred <- sample(0:1,size=nrow(data),replace=TRUE)
data_k_list <- fn_cross_index(base = data,k = 5)
data_k_list$index1
data_k_list$index2
data_k_list$index3
data_k_list$index4
data_k_list$index5
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.