sakura.utils.data_splitter.DataSplitter.auto_random_k_fold_cv_split

DataSplitter.auto_random_k_fold_cv_split(base: ndarray, k: int, seed=None)

Obtain 2*k split codes based on random K-Fold split, where train or test are labelled as 1 (corresp.).

Useful when planning for a K-Fold cross validation.

Parameters:
  • base (np.ndarray[base.dtype, np.integer]) – The predefined label vector to work with, 0: not included, 1: included

  • k (int) – The number of included points and overall bin divisions

  • seed (int, optional) – a temporary random seed

Returns:

A dictionary with k folding keys, mapped to k dictionaries with “train” and “test” split codes

Return type:

dict[str, dict[str, np.ndarray]]