This is the constructor of the resampling
class.
Usage
resampling(
method = c("rswor", "srswor", "stratified_rswor", "balanced_rswor", "permutation",
"kfolds", "stratified_kfolds", "balanced_kfolds", "leave_p_out", "leave_one_out",
"rswr", "srswr", "stratified_rswr", "balanced_rswr", "bootstrap"),
N = integer(),
removed = integer(),
samples = list(integer())
)
Arguments
- method
character, the id of the used sampling method
- N
integer, the population size
- removed
integer, the indices of elements removed prior to sampling
- samples
list, each element is an integer vector containing the samples
Details
An object of class resampling
is a named list with 4 elements:
method
the id of the used sampling method
N
the size of the population from which the samples were taken. Elements in the population have index from 1 to N
removed
(optional) vector of indices of elements removed from the population before taking the samples
samples
list of samples repeatedly taken from the population. Each element of the list is an integer vector containing the indices of the elements sampled from the population
Functions to facilitate access to the data stored in a resampling
object are
available:
?getSamplingMethodId
: returns the sampling method id?getPopulationSize
: returns the population size?getRemovedElements
: returns the indices of elements removed from the population?getNumberOfSamples
: returns the number of taken samples?getSamples
: returns the list of samples?getSampleSize
: returns a vector of integer values, the size of each sample?getHoldOutSample
: returns a list where each item is an integer vector containing the indices of the elements not sampled from the population?getHoldOutSampleSize
:returns a vector of integer values, the size of each hold-out sample
Other useful functions include:
Examples
#default
resampling()
#>
#> 1 samples taken from a population of elements by using random sampling
#> without replacement.
#>
#> sampleNumber sample sampleSize holdoutSize
#> 1 1 0 0
#>
#resampling object
resampling(
method = 'rswor',
N = 10,
samples = list(c(1,5,7))
)
#>
#> 1 samples taken from a population of 10 elements by using random
#> sampling without replacement.
#>
#> sampleNumber sample sampleSize holdoutSize
#> 1 1 1, 5, 7 3 7
#>