docstr: Split the input data into random train and test subsets.
  
  Parameters
  ----------
  x: numpy array
     input data.
  y: numpy array
     target data.
  test_size: float or int, 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.
      If train_size is also None, it will be set to 0.25.
  train_size: float or int, optional
      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
      Controls the shuffling applied to the data before applying
      the split. Pass an int for reproducible output across multiple
      function calls. See Glossary.
  shuffle: bool, optional
      Whether or not to shuffle the data before splitting.
      If shuffle=False then stratify must be None.
  stratify: array-like, optional
      If not None, data is split in a stratified fashion,
      using this as the class labels. Read more in the User Guide.
  
  Returns
  -------
  Tuple of four numpy arrays: x_train, x_test, y_train, y_test.
docstr_tok: ["Split","the","input","data","into","random","train","and","test","subsets",".","Parameters","--","--","--","--","--","x",":","numpy","array","input","data",".","y",":","numpy","array","target","data",".","test_size",":","float","or","int",",","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",".","If","train_size","is","also","None",",","it","will","be","set","to","0.25.","train_size",":","float","or","int",",","optional","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","Controls","the","shuffling","applied","to","the","data","before","applying","the","split",".","Pass","an","int","for","reproducible","output","across","multiple","function","calls",".","See","Glossary",".","shuffle",":","bool",",","optional","Whether","or","not","to","shuffle","the","data","before","splitting",".","If","shuffle=False","then","stratify","must","be","None",".","stratify",":","array-like",",","optional","If","not","None",",","data","is","split","in","a","stratified","fashion",",","using","this","as","the","class","labels",".","Read","more","in","the","User","Guide",".","Returns","--","--","--","-","Tuple","of","four","numpy","arrays",":","x_train",",","x_test",",","y_train",",","y_test","."]
code: def train_test_split(
      self,
      x,
      y,
      test_size=None,
      train_size=None,
      random_state=None,
      shuffle=True,
      stratify=None,
  ):
      """Split the input data into random train and test subsets.
  
      Parameters
      ----------
      x: numpy array
         input data.
      y: numpy array
         target data.
      test_size: float or int, 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.
          If train_size is also None, it will be set to 0.25.
      train_size: float or int, optional
          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
          Controls the shuffling applied to the data before applying
          the split. Pass an int for reproducible output across multiple
          function calls. See Glossary.
      shuffle: bool, optional
          Whether or not to shuffle the data before splitting.
          If shuffle=False then stratify must be None.
      stratify: array-like, optional
          If not None, data is split in a stratified fashion,
          using this as the class labels. Read more in the User Guide.
  
      Returns
      -------
      Tuple of four numpy arrays: x_train, x_test, y_train, y_test.
      """
      sz = x.shape
      if len(sz) == 4:
          x = np.reshape(x, (sz[0] * sz[1] * sz[2], sz[3]))
      sz = y.shape
      if len(sz) == 4:
          y = np.reshape(y, (sz[0] * sz[1] * sz[2], sz[3]))
      return sklearn.train_test_split(
          x,
          y,
          test_size=test_size,
          train_size=train_size,
          random_state=random_state,
          shuffle=shuffle,
          stratify=stratify,
      )
  
file_path: dipy/dipy/nn/cnn_1d_denoising.py
imports: from dipy.utils.optpkg import optional_package
  import numpy
label_desc: Use image node_id 4 for calling the Cnn1DDenoiser obj's underlying member method code with example usage: obj.train_test_split(x, y, test_size, train_size, random_state, shuffle, stratify) and returns: sklearn