Modelkit.Stratified_shuffle_splitShuffled partitions with proportional class allocation; defaults to ten splits and a 10% test fraction. Requires aligned classification labels, at least two rows per class, and at least as many rows per partition as classes. Largest-remainder allocation fills training first, then test from remaining rows, with seeded tie breaking. Extreme imbalance can still omit a rare class from a partition. Classes follow first appearance order. Random streams are deterministic for the same input and seed, independent of execution scheduling; they do not reproduce NumPy random streams. Groups do not constrain these splits; use group-aware splitting when group exclusion is required.
val create :
?splits:int ->
?train_size:Split_size.t ->
?test_size:Split_size.t ->
unit ->
(t, Error.t) resultinclude SPLITTER
with type t := t
and type params := params
and type target = Target.classification Target.t
and type rng = Rng.ttype target = Target.classification Target.ttype rng = Rng.tval split :
t ->
rng:rng ->
?groups:Groups.t ->
x:Matrix.t ->
y:target option ->
unit ->
((Row_view.t * Row_view.t) array, Error.t) result