View source: R/sperrorest_resampling.R
partition_factor | R Documentation |
partition_factor
creates a represampling object, i.e. a set
of sample indices defining cross-validation test and training sets.
partition_factor(
data,
coords = c("x", "y"),
fac,
return_factor = FALSE,
repetition = 1
)
data |
|
coords |
vector of length 2 defining the variables in |
fac |
either the name of a variable (column) in |
return_factor |
if |
repetition |
numeric vector: cross-validation repetitions to be
generated. Note that this is not the number of repetitions, but the indices
of these repetitions. E.g., use |
A represampling object, see also partition_cv for details.
In this partitioning approach, all repetition
s are identical and
therefore pseudo-replications.
sperrorest, partition_cv, as.resampling.factor
data(ecuador)
# I don't recommend using this partitioning for cross-validation,
# this is only for demonstration purposes:
breaks <- quantile(ecuador$dem, seq(0, 1, length = 6))
ecuador$zclass <- cut(ecuador$dem, breaks, include.lowest = TRUE)
summary(ecuador$zclass)
parti <- partition_factor(ecuador, fac = "zclass")
# plot(parti,ecuador)
summary(parti)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.