% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats_cv_sets_methods.R
\name{.cvSetsMethod}
\alias{.cvSetsMethod}
\title{Generate Cross-Validation (CV) Training Set Indices}
\usage{
.cvSetsMethod(
  Y,
  type,
  method = "k-fold_stratified",
  k = 7,
  split = 2/3,
  probs = NULL
)
}
\arguments{
\item{Y}{matrix or data.frame. Outcome matrix. If multi-column, only the first column will be used.}

\item{type}{character. Type of analysis: "R" for regression or "DA" for discriminant analysis. Use suffix "-mY" to indicate multi-column Y.}

\item{method}{character. One of: \code{"k-fold"}, \code{"k-fold_stratified"}, \code{"MC"}, \code{"MC_balanced"}.}

\item{k}{integer. Number of CV iterations/folds.}

\item{split}{numeric. For Monte Carlo methods, the fraction of samples to use in the training set (0 < split < 1).}

\item{probs}{Numeric vector. Probabilities used for stratification of numeric \code{Y} (regression only).}
}
\value{
A list of integer vectors. Each vector contains row indices representing a training set.
}
\description{
Generates a list of row indices representing training sets for various CV strategies including stratified and Monte Carlo methods. Handles both regression (R) and discriminant analysis (DA), and multi-column Y.
}
\details{
\itemize{
\item In \code{"k-fold_stratified"} and \code{"MC_balanced"} modes, stratification is applied to preserve class proportions or outcome distribution.
\item If \code{type} is regression (\code{"R"}), quantile-based binning is applied to stratify continuous Y values.
\item If \code{type} is discriminant analysis (\code{"DA"}), class labels are used directly.
\item If \code{Y} has multiple columns, only the first column is used to create resampling sets.
}
}
\keyword{internal}
