data_partition
creates a test/training partition.
data_partition(y, p = 0.5, groups = min(5, length(y)))
y
, the number of breaks in the quantiles
(see below)y
when y
is a
factor in an attempt to balance the class distributions within the splits.For numeric y
, the sample is split into groups sections based on
percentiles and sampling is done within these subgroups. The number of
percentiles is set via the groups
argument.
Also, very small class sizes (