class_docstr: Multilabel Stratified ShuffleSplit cross-validator
  Provides train/test indices to split data into train/test sets.
  This cross-validation object is a merge of MultilabelStratifiedKFold and
  ShuffleSplit, which returns stratified randomized folds for multilabel
  data. The folds are made by preserving the percentage of each label.
  Note: like the ShuffleSplit strategy, multilabel stratified random splits
  do not guarantee that all folds will be different, although this is
  still very likely for sizeable datasets.
  Parameters
  ----------
  n_splits : int, default 10
      Number of re-shuffling & splitting iterations.
  test_size : float, int, None, optional
      If float, should be between 0.0 and 1.0 and represent the proportion
      of the dataset to include in the test split. If int, represents the
      absolute number of test samples. If None, the value is set to the
      complement of the train size. By default, the value is set to 0.1.
      The default will change in version 0.21. It will remain 0.1 only
      if ``train_size`` is unspecified, otherwise it will complement
      the specified ``train_size``.
  train_size : float, int, or None, default is None
      If float, should be between 0.0 and 1.0 and represent the
      proportion of the dataset to include in the train split. If
      int, represents the absolute number of train samples. If None,
      the value is automatically set to the complement of the test size.
  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 StratifiedShuffleSplit 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 MultilabelStratifiedShuffleSplit
  >>> 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]])
  >>> msss = MultilabelStratifiedShuffleSplit(n_splits=3, test_size=0.5,
  ...    random_state=0)
  >>> msss.get_n_splits(X, y)
  3
  >>> print(mss)       # doctest: +ELLIPSIS
  MultilabelStratifiedShuffleSplit(n_splits=3, random_state=0, test_size=0.5,
                                   train_size=None)
  >>> for train_index, test_index in msss.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: [1 2 5 7] TEST: [0 3 4 6]
  TRAIN: [2 3 6 7] TEST: [0 1 4 5]
  TRAIN: [1 2 5 6] TEST: [0 3 4 7]
  Notes
  -----
  Train and test sizes may be slightly different from desired due to the
  preference of stratification over perfectly sized folds.
class_docstr_tok: ["Multilabel","Stratified","ShuffleSplit","cross-validator","Provides","train\/test","indices","to","split","data","into","train\/test","sets",".","This","cross-validation","object","is","a","merge","of","MultilabelStratifiedKFold","and","ShuffleSplit",",","which","returns","stratified","randomized","folds","for","multilabel","data",".","The","folds","are","made","by","preserving","the","percentage","of","each","label",".","Note",":","like","the","ShuffleSplit","strategy",",","multilabel","stratified","random","splits","do","not","guarantee","that","all","folds","will","be","different",",","although","this","is","still","very","likely","for","sizeable","datasets",".","Parameters","--","--","--","--","--","n_splits",":","int",",","default","10","Number","of","re-shuffling","&","splitting","iterations",".","test_size",":","float",",","int",",","None",",","optional","If","float",",","should","be","between","0.0","and","1.0","and","represent","the","proportion","of","the","dataset","to","include","in","the","test","split",".","If","int",",","represents","the","absolute","number","of","test","samples",".","If","None",",","the","value","is","set","to","the","complement","of","the","train","size",".","By","default",",","the","value","is","set","to","0.1",".","The","default","will","change","in","version","0.21",".","It","will","remain","0.1","only","if","``","train_size","``","is","unspecified",",","otherwise","it","will","complement","the","specified","``","train_size","``",".","train_size",":","float",",","int",",","or","None",",","default","is","None","If","float",",","should","be","between","0.0","and","1.0","and","represent","the","proportion","of","the","dataset","to","include","in","the","train","split",".","If","int",",","represents","the","absolute","number","of","train","samples",".","If","None",",","the","value","is","automatically","set","to","the","complement","of","the","test","size",".","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","StratifiedShuffleSplit","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","MultilabelStratifiedShuffleSplit",">",">",">","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","]","]",")",">",">",">","msss","=","MultilabelStratifiedShuffleSplit","(","n_splits=3",",","test_size=0.5",",","...","random_state=0",")",">",">",">","msss.get_n_splits","(","X",",","y",")","3",">",">",">","print","(","mss",")","#","doctest",":","+ELLIPSIS","MultilabelStratifiedShuffleSplit","(","n_splits=3",",","random_state=0",",","test_size=0.5",",","train_size=None",")",">",">",">","for","train_index",",","test_index","in","msss.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",":","[","1","2","5","7","]","TEST",":","[","0","3","4","6","]","TRAIN",":","[","2","3","6","7","]","TEST",":","[","0","1","4","5","]","TRAIN",":","[","1","2","5","6","]","TEST",":","[","0","3","4","7","]","Notes","--","--","-","Train","and","test","sizes","may","be","slightly","different","from","desired","due","to","the","preference","of","stratification","over","perfectly","sized","folds","."]
code: def __init__(
      self,
      n_splits=10,
      *,
      test_size="default",
      train_size=None,
      random_state=None,
  ):
      super(MultilabelStratifiedShuffleSplit, self).__init__(
          n_splits=n_splits,
          test_size=test_size,
          train_size=train_size,
          random_state=random_state,
      )
  
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 1 to create a new MultilabelStratifiedShuffleSplit object from inherited base classes: BaseShuffleSplit with example: obj = MultilabelStratifiedShuffleSplit(n_splits)