class_docstr: Multilabel stratified K-Folds cross-validator
  Provides train/test indices to split multilabel data into train/test sets.
  This cross-validation object is a variation of KFold that returns
  stratified folds for multilabel data. The folds are made by preserving
  the percentage of samples for each label.
  Parameters
  ----------
  n_splits : int, default=3
      Number of folds. Must be at least 2.
  shuffle : boolean, optional
      Whether to shuffle each stratification of the data before splitting
      into batches.
  random_state : int, RandomState instance or None, optional, default=None
      If int, random_state is the seed used by the random number generator;
      If RandomState instance, random_state is the random number generator;
      If None, the random number generator is the RandomState instance used
      by `np.random`. Unlike StratifiedKFold that only uses random_state
      when ``shuffle`` == True, this multilabel implementation
      always uses the random_state since the iterative stratification
      algorithm breaks ties randomly.
  Examples
  --------
  >>> from iterstrat.ml_stratifiers import MultilabelStratifiedKFold
  >>> import numpy as np
  >>> X = np.array([[1,2], [3,4], [1,2], [3,4], [1,2], [3,4], [1,2], [3,4]])
  >>> y = np.array([[0,0], [0,0], [0,1], [0,1], [1,1], [1,1], [1,0], [1,0]])
  >>> mskf = MultilabelStratifiedKFold(n_splits=2, random_state=0)
  >>> mskf.get_n_splits(X, y)
  2
  >>> print(mskf)  # doctest: +NORMALIZE_WHITESPACE
  MultilabelStratifiedKFold(n_splits=2, random_state=0, shuffle=False)
  >>> for train_index, test_index in mskf.split(X, y):
  ...    print("TRAIN:", train_index, "TEST:", test_index)
  ...    X_train, X_test = X[train_index], X[test_index]
  ...    y_train, y_test = y[train_index], y[test_index]
  TRAIN: [0 3 4 6] TEST: [1 2 5 7]
  TRAIN: [1 2 5 7] TEST: [0 3 4 6]
  Notes
  -----
  Train and test sizes may be slightly different in each fold.
  See also
  --------
  RepeatedMultilabelStratifiedKFold: Repeats Multilabel Stratified K-Fold
  n times.
class_docstr_tok: ["Multilabel","stratified","K-Folds","cross-validator","Provides","train\/test","indices","to","split","multilabel","data","into","train\/test","sets",".","This","cross-validation","object","is","a","variation","of","KFold","that","returns","stratified","folds","for","multilabel","data",".","The","folds","are","made","by","preserving","the","percentage","of","samples","for","each","label",".","Parameters","--","--","--","--","--","n_splits",":","int",",","default=3","Number","of","folds",".","Must","be","at","least","2.","shuffle",":","boolean",",","optional","Whether","to","shuffle","each","stratification","of","the","data","before","splitting","into","batches",".","random_state",":","int",",","RandomState","instance","or","None",",","optional",",","default=None","If","int",",","random_state","is","the","seed","used","by","the","random","number","generator",";","If","RandomState","instance",",","random_state","is","the","random","number","generator",";","If","None",",","the","random","number","generator","is","the","RandomState","instance","used","by","`","np.random","`",".","Unlike","StratifiedKFold","that","only","uses","random_state","when","``","shuffle","``","==","True",",","this","multilabel","implementation","always","uses","the","random_state","since","the","iterative","stratification","algorithm","breaks","ties","randomly",".","Examples","--","--","--","--",">",">",">","from","iterstrat.ml_stratifiers","import","MultilabelStratifiedKFold",">",">",">","import","numpy","as","np",">",">",">","X","=","np.array","(","[","[","1,2","]",",","[","3,4","]",",","[","1,2","]",",","[","3,4","]",",","[","1,2","]",",","[","3,4","]",",","[","1,2","]",",","[","3,4","]","]",")",">",">",">","y","=","np.array","(","[","[","0,0","]",",","[","0,0","]",",","[","0,1","]",",","[","0,1","]",",","[","1,1","]",",","[","1,1","]",",","[","1,0","]",",","[","1,0","]","]",")",">",">",">","mskf","=","MultilabelStratifiedKFold","(","n_splits=2",",","random_state=0",")",">",">",">","mskf.get_n_splits","(","X",",","y",")","2",">",">",">","print","(","mskf",")","#","doctest",":","+NORMALIZE_WHITESPACE","MultilabelStratifiedKFold","(","n_splits=2",",","random_state=0",",","shuffle=False",")",">",">",">","for","train_index",",","test_index","in","mskf.split","(","X",",","y",")",":","...","print","(","``","TRAIN",":","''",",","train_index",",","``","TEST",":","''",",","test_index",")","...","X_train",",","X_test","=","X","[","train_index","]",",","X","[","test_index","]","...","y_train",",","y_test","=","y","[","train_index","]",",","y","[","test_index","]","TRAIN",":","[","0","3","4","6","]","TEST",":","[","1","2","5","7","]","TRAIN",":","[","1","2","5","7","]","TEST",":","[","0","3","4","6","]","Notes","--","--","-","Train","and","test","sizes","may","be","slightly","different","in","each","fold",".","See","also","--","--","--","--","RepeatedMultilabelStratifiedKFold",":","Repeats","Multilabel","Stratified","K-Fold","n","times","."]
docstr: Generate indices to split data into training and test set.
  Parameters
  ----------
  X : array-like, shape (n_samples, n_features)
      Training data, where n_samples is the number of samples
      and n_features is the number of features.
      Note that providing ``y`` is sufficient to generate the splits and
      hence ``np.zeros(n_samples)`` may be used as a placeholder for
      ``X`` instead of actual training data.
  y : array-like, shape (n_samples, n_labels)
      The target variable for supervised learning problems.
      Multilabel stratification is done based on the y labels.
  groups : object
      Always ignored, exists for compatibility.
  Returns
  -------
  train : ndarray
      The training set indices for that split.
  test : ndarray
      The testing set indices for that split.
  Notes
  -----
  Randomized CV splitters may return different results for each call of
  split. You can make the results identical by setting ``random_state``
  to an integer.
docstr_tok: ["Generate","indices","to","split","data","into","training","and","test","set",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","(","n_samples",",","n_features",")","Training","data",",","where","n_samples","is","the","number","of","samples","and","n_features","is","the","number","of","features",".","Note","that","providing","``","y","``","is","sufficient","to","generate","the","splits","and","hence","``","np.zeros","(","n_samples",")","``","may","be","used","as","a","placeholder","for","``","X","``","instead","of","actual","training","data",".","y",":","array-like",",","shape","(","n_samples",",","n_labels",")","The","target","variable","for","supervised","learning","problems",".","Multilabel","stratification","is","done","based","on","the","y","labels",".","groups",":","object","Always","ignored",",","exists","for","compatibility",".","Returns","--","--","--","-","train",":","ndarray","The","training","set","indices","for","that","split",".","test",":","ndarray","The","testing","set","indices","for","that","split",".","Notes","--","--","-","Randomized","CV","splitters","may","return","different","results","for","each","call","of","split",".","You","can","make","the","results","identical","by","setting","``","random_state","``","to","an","integer","."]
code: def split(self, X, y, groups=None):
      """Generate indices to split data into training and test set.
      Parameters
      ----------
      X : array-like, shape (n_samples, n_features)
          Training data, where n_samples is the number of samples
          and n_features is the number of features.
          Note that providing ``y`` is sufficient to generate the splits and
          hence ``np.zeros(n_samples)`` may be used as a placeholder for
          ``X`` instead of actual training data.
      y : array-like, shape (n_samples, n_labels)
          The target variable for supervised learning problems.
          Multilabel stratification is done based on the y labels.
      groups : object
          Always ignored, exists for compatibility.
      Returns
      -------
      train : ndarray
          The training set indices for that split.
      test : ndarray
          The testing set indices for that split.
      Notes
      -----
      Randomized CV splitters may return different results for each call of
      split. You can make the results identical by setting ``random_state``
      to an integer.
      """
      y = check_array(y, ensure_2d=False, dtype=None)
      return super(MultilabelStratifiedKFold, self).split(X, y, groups)
  
file_path: iterative-stratification/iterstrat/ml_stratifiers.py
imports: import numpy
  from sklearn.utils import check_random_state
  from sklearn.utils.validation import _num_samples, check_array
  from sklearn.utils.multiclass import type_of_target
  from sklearn.model_selection._split import _BaseKFold, _RepeatedSplits, BaseShuffleSplit, _validate_shuffle_split
label_desc: Use image node_id 4 for calling the MultilabelStratifiedKFold obj's underlying member method code with example usage: obj.split(X, y, groups) and returns: super