class_docstr: Cross-validation iterator over split predefined in files.
  
  This class is useful in orchestration where the train and test set is provided in
  separate files.
class_docstr_tok: ["Cross-validation","iterator","over","split","predefined","in","files",".","This","class","is","useful","in","orchestration","where","the","train","and","test","set","is","provided","in","separate","files","."]
docstr: Split the data according to the train/test index.
  
  Parameters
  ----------
  data : pandas.DataFrame
  
  Yields
  ------
  train : ndarray
      Train indices
  test : ndarray
      Test indices
docstr_tok: ["Split","the","data","according","to","the","train\/test","index",".","Parameters","--","--","--","--","--","data",":","pandas.DataFrame","Yields","--","--","--","train",":","ndarray","Train","indices","test",":","ndarray","Test","indices"]
code: def split(self, data, y=None, groups=None):
      """Split the data according to the train/test index.
  
      Parameters
      ----------
      data : pandas.DataFrame
  
      Yields
      ------
      train : ndarray
          Train indices
      test : ndarray
          Test indices
      """
      # check input
      if not isinstance(data, pd.DataFrame):
          raise ValueError(
              f"Data must be pandas DataFrame, but found {type(data)}"
          )
      if not np.all(
          data.index.get_level_values(0)
          .unique()
          .isin(["train", "test"])
      ):
          raise ValueError(
              "Train-test split not properly defined in "
              "index of passed pandas DataFrame"
          )
  
      # this is a bit of a hack, PresplitFilesCV would need to talk to the
      # data loader during orchestration,
      # but since this is not possible with sklearn's interface, we load
      # both files separately, combined them
      # keep the training and test split in the index of the combined
      # dataframe, and split them here again
      n_instances = data.shape[0]
      idx = np.arange(n_instances)
      train = data.index.get_level_values(0) == "train"
      test = data.index.get_level_values(0) == "test"
      train = idx[train]
      test = idx[test]
      yield train, test
  
      # if additionally a cv iterator is provided, yield the predefined
      # split first, then reshuffle and apply cv,
      # note that test sets may overlap with the presplit file test set
      if self.cv is not None:
          for train, test in self.cv.split(idx, y=y):
              yield train, test
  
file_path: sktime/sktime/series_as_features/model_selection/_split.py
imports: import numpy
  import pandas
  from sklearn.model_selection import train_test_split
label_desc: Use image node_id 2 for calling the PresplitFilesCV obj's underlying member method code with example usage: obj.split(data, y, groups) without return types