% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats_cv_sets_methods.R
\name{kfold}
\alias{kfold}
\title{K-fold cross-validation strategy}
\usage{
kfold(k)
}
\arguments{
\item{k}{Integer number of folds.}
}
\value{
A named \code{list} with elements:
\describe{
\item{train}{List of integer vectors containing training set indices
for each resampling iteration.}
\item{strategy}{Character string indicating the resampling strategy.}
\item{n}{Integer. Number of samples in the dataset.}
\item{seed}{Integer. Random seed used to generate the resampling splits,
ensuring reproducibility.}
}
}
\description{
K-fold cross-validation strategy
}
\details{
Partitions the data into \code{k} folds. Each fold is used once as a test set,
with the remaining folds used for training.
No stratification is applied; folds are created by random partitioning.
}
\examples{
n <- 100
thr <- 1.5
Y <- c(rnorm(80, thr - 3, 0.3), rnorm(20, thr + 3, 0.3))  # unbalanced outcome
mean(Y > thr)
cv_k  <- kfold(k = 10)
k_inst <- metabom8:::.arg_check_cv(cv_pars=cv_k, model_type='R', n=n, Y_prepped=cbind(Y))
sapply(k_inst$train, function(i) length(i))
}
\seealso{
Other resampling strategies: 
\code{\link{balanced_boot}()},
\code{\link{balanced_mc}()},
\code{\link{mc}()},
\code{\link{stratified_kfold}()}
}
\concept{resampling strategies}
