class_docstr: Temporal train-test splitter, based on sample sizes of train or test set.
  
  Cuts test and train sets from the start or end of available data,
  based on ``test_size`` and ``train_size`` parameters,
  which can signify fractions of total number of indices,
  or an absolute number of integers to cut.
  
  If the data contains multiple time series (Panel or Hierarchical),
  fractions and train-test sets will be computed per individual time series.
  
  Parameters
  ----------
  test_size : float, int or None, optional (default=None)
      If float, must be between 0.0 and 1.0, and is interpreted as the proportion
      of the dataset to include in the test split. Proportions are rounded to the
      next higher integer count of samples (ceil).
      If int, is interpreted as total 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, int, or None, (default=None)
      If float, must be between 0.0 and 1.0, and is interpreted as the proportion
      of the dataset to include in the train split. Proportions are rounded to the
      next lower integer count of samples (floor).
      If int, is interpreted as total number of train samples.
      If None, the value is set to the complement of the test size.
  anchor : str, "start" (default) or "end"
      determines behaviour if train and test sizes do not sum up to all data
      if "start", cuts train and test set from start of available series
      if "end", cuts train and test set from end of available series
  
  Examples
  --------
  >>> import numpy as np
  >>> from sktime.split import TemporalTrainTestSplitter
  >>> ts = np.arange(10)
  >>> splitter = TemporalTrainTestSplitter(test_size=0.3)
  >>> list(splitter.split(ts)) # doctest: +SKIP
class_docstr_tok: ["Temporal","train-test","splitter",",","based","on","sample","sizes","of","train","or","test","set",".","Cuts","test","and","train","sets","from","the","start","or","end","of","available","data",",","based","on","``","test_size","``","and","``","train_size","``","parameters",",","which","can","signify","fractions","of","total","number","of","indices",",","or","an","absolute","number","of","integers","to","cut",".","If","the","data","contains","multiple","time","series","(","Panel","or","Hierarchical",")",",","fractions","and","train-test","sets","will","be","computed","per","individual","time","series",".","Parameters","--","--","--","--","--","test_size",":","float",",","int","or","None",",","optional","(","default=None",")","If","float",",","must","be","between","0.0","and","1.0",",","and","is","interpreted","as","the","proportion","of","the","dataset","to","include","in","the","test","split",".","Proportions","are","rounded","to","the","next","higher","integer","count","of","samples","(","ceil",")",".","If","int",",","is","interpreted","as","total","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",",","int",",","or","None",",","(","default=None",")","If","float",",","must","be","between","0.0","and","1.0",",","and","is","interpreted","as","the","proportion","of","the","dataset","to","include","in","the","train","split",".","Proportions","are","rounded","to","the","next","lower","integer","count","of","samples","(","floor",")",".","If","int",",","is","interpreted","as","total","number","of","train","samples",".","If","None",",","the","value","is","set","to","the","complement","of","the","test","size",".","anchor",":","str",",","``","start","''","(","default",")","or","``","end","''","determines","behaviour","if","train","and","test","sizes","do","not","sum","up","to","all","data","if","``","start","''",",","cuts","train","and","test","set","from","start","of","available","series","if","``","end","''",",","cuts","train","and","test","set","from","end","of","available","series","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sktime.split","import","TemporalTrainTestSplitter",">",">",">","ts","=","np.arange","(","10",")",">",">",">","splitter","=","TemporalTrainTestSplitter","(","test_size=0.3",")",">",">",">","list","(","splitter.split","(","ts",")",")","#","doctest",":","+SKIP"]
code: def _split(self, y: pd.Index):
      test_size = self.test_size
      train_size = self.train_size
      anchor = self.anchor
  
      len_y = len(y)
  
      if test_size is None and train_size is None:
          test_size = 0.25
  
      if train_size is None:
          anchor = "end"
      if test_size is None:
          anchor = "start"
  
      if isinstance(test_size, float):
          test_size = math.ceil(test_size * len(y))
      if isinstance(train_size, float):
          train_size = math.floor(train_size * len(y))
      if test_size is None:
          test_size = len_y - train_size
      if train_size is None:
          train_size = len_y - test_size
  
      if anchor == "end":
          test_size = min(len_y, test_size)
          train_size = min(len_y - test_size, train_size)
      else:
          train_size = min(len_y, train_size)
          test_size = min(len_y - train_size, test_size)
  
      all_ix = np.arange(len_y)
  
      if anchor == "end":
          y_train_ix = all_ix[:-test_size]
          y_test_ix = all_ix[-test_size:]
          y_train_ix = y_train_ix[-train_size:]
      else:  # if anchor == "start"
          y_train_ix = all_ix[:train_size]
          y_test_ix = all_ix[train_size:]
          y_test_ix = y_test_ix[:test_size]
  
      yield y_train_ix, y_test_ix
  
file_path: sktime/sktime/split/temporal_train_test_split.py
imports: import math
  from typing import Optional
  import numpy
  import pandas
  from sktime.split.base import BaseSplitter
  from sktime.split.base._common import ACCEPTED_Y_TYPES, FORECASTING_HORIZON_TYPES, SPLIT_TYPE, _split_by_fh
label_desc: Use image node_id 2 for calling the TemporalTrainTestSplitter obj's underlying member method code with example usage: obj._split(y) without return types