This function selects the indices for the training set based on the class
vector response. It allows for optional downsampling to balance the class
distribution by limiting the number of samples per class.
getDownSampleInd(response, downSampling = FALSE, kSample = NULL)An integer vector of indices representing the selected samples from
the original response vector.
A factor vector representing the class labels.
A logical value indicating whether downsampling should be
applied. If TRUE, downsampling is performed to limit the number of
samples per class based on kSample. Note that this may not result in
equal class frequencies, as kSample defines an upper limit for each
class, not a lower limit.
An integer specifying the maximum number of samples to be
selected per class. If NULL, the number of samples is limited to the size
of the smallest class.