class_docstr: Splitters split up Datasets into pieces for training/validation/testing.
  
  In machine learning applications, it's often necessary to split up a dataset
  into training/validation/test sets. Or to k-fold split a dataset (that is,
  divide into k equal subsets) for cross-validation. The `Splitter` class is
  an abstract superclass for all splitters that captures the common API across
  splitter classes.
  
  Note that `Splitter` is an abstract superclass. You won't want to
  instantiate this class directly. Rather you will want to use a concrete
  subclass for your application.
class_docstr_tok: ["Splitters","split","up","Datasets","into","pieces","for","training\/validation\/testing",".","In","machine","learning","applications",",","it","'s","often","necessary","to","split","up","a","dataset","into","training\/validation\/test","sets",".","Or","to","k-fold","split","a","dataset","(","that","is",",","divide","into","k","equal","subsets",")","for","cross-validation",".","The","`","Splitter","`","class","is","an","abstract","superclass","for","all","splitters","that","captures","the","common","API","across","splitter","classes",".","Note","that","`","Splitter","`","is","an","abstract","superclass",".","You","wo","n't","want","to","instantiate","this","class","directly",".","Rather","you","will","want","to","use","a","concrete","subclass","for","your","application","."]
docstr: Splits self into train/test sets.
  
  Returns Dataset objects for train/test.
  
  Parameters
  ----------
  dataset: data like object
      Dataset to be split.
  train_dir: str, optional (default None)
      If specified, the directory in which the generated
      training dataset should be stored. This is only
      considered if `isinstance(dataset, dc.data.DiskDataset)`
      is True.
  test_dir: str, optional (default None)
      If specified, the directory in which the generated
      test dataset should be stored. This is only
      considered if `isinstance(dataset, dc.data.DiskDataset)`
      is True.
  frac_train: float, optional (default 0.8)
      The fraction of data to be used for the training split.
  seed: int, optional (default None)
      Random seed to use.
  
  Returns
  -------
  Tuple[Dataset, Dataset]
      A tuple of train and test datasets as dc.data.Dataset objects.
docstr_tok: ["Splits","self","into","train\/test","sets",".","Returns","Dataset","objects","for","train\/test",".","Parameters","--","--","--","--","--","dataset",":","data","like","object","Dataset","to","be","split",".","train_dir",":","str",",","optional","(","default","None",")","If","specified",",","the","directory","in","which","the","generated","training","dataset","should","be","stored",".","This","is","only","considered","if","`","isinstance","(","dataset",",","dc.data.DiskDataset",")","`","is","True",".","test_dir",":","str",",","optional","(","default","None",")","If","specified",",","the","directory","in","which","the","generated","test","dataset","should","be","stored",".","This","is","only","considered","if","`","isinstance","(","dataset",",","dc.data.DiskDataset",")","`","is","True",".","frac_train",":","float",",","optional","(","default","0.8",")","The","fraction","of","data","to","be","used","for","the","training","split",".","seed",":","int",",","optional","(","default","None",")","Random","seed","to","use",".","Returns","--","--","--","-","Tuple","[","Dataset",",","Dataset","]","A","tuple","of","train","and","test","datasets","as","dc.data.Dataset","objects","."]
code: def train_test_split(
      self,
      dataset: Dataset,
      train_dir: Optional[str] = None,
      test_dir: Optional[str] = None,
      frac_train: float = 0.8,
      seed: Optional[int] = None,
      **kwargs,
  ) -> Tuple[Dataset, Dataset]:
      """Splits self into train/test sets.
  
      Returns Dataset objects for train/test.
  
      Parameters
      ----------
      dataset: data like object
          Dataset to be split.
      train_dir: str, optional (default None)
          If specified, the directory in which the generated
          training dataset should be stored. This is only
          considered if `isinstance(dataset, dc.data.DiskDataset)`
          is True.
      test_dir: str, optional (default None)
          If specified, the directory in which the generated
          test dataset should be stored. This is only
          considered if `isinstance(dataset, dc.data.DiskDataset)`
          is True.
      frac_train: float, optional (default 0.8)
          The fraction of data to be used for the training split.
      seed: int, optional (default None)
          Random seed to use.
  
      Returns
      -------
      Tuple[Dataset, Dataset]
          A tuple of train and test datasets as dc.data.Dataset objects.
      """
      valid_dir = tempfile.mkdtemp()
      train_dataset, _, test_dataset = self.train_valid_test_split(
          dataset,
          train_dir,
          valid_dir,
          test_dir,
          frac_train=frac_train,
          frac_test=1 - frac_train,
          frac_valid=0.0,
          seed=seed,
          **kwargs,
      )
      return train_dataset, test_dataset
  
imports: import inspect
  import itertools
  import logging
  import os
  import random
  import tempfile
  from typing import Any, Dict, Iterator, List, Optional, Sequence, Tuple, Union
  import deepchem
  import numpy
  import pandas
  from deepchem.data import Dataset, DiskDataset
  from deepchem.utils import get_print_threshold
label_desc: Use image node_id 3 for calling the Splitter obj's underlying member method code with example usage: obj.train_test_split(dataset, train_dir, test_dir, frac_train, seed) and returns: train_dataset,  test_dataset