package modelkit

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Modelkit.Repeated_stratified_k_fold

Repeated shuffled stratified K-fold, with five folds and ten repetitions by default. Uses the class allocation and feasibility rules of Stratified_k_fold; rare classes can be absent in a fold. Splits are repetition-major, then fold-major, and indices retain source order. Extending the repetition count preserves earlier repetitions. 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.

type params = {
  1. folds : int;
  2. repeats : int;
}
type t
val create : ?folds:int -> ?repeats:int -> unit -> (t, Error.t) result
include SPLITTER with type t := t and type params := params and type target = Target.classification Target.t and type rng = Rng.t
include SPECIFICATION with type t := t with type params := params
val clone : t -> t
val params : t -> params
type rng = Rng.t
val split : t -> rng:rng -> ?groups:Groups.t -> x:Matrix.t -> y:target option -> unit -> ((Row_view.t * Row_view.t) array, Error.t) result