class_docstr: K-fold iterator variant for temporal splitting of time series data
  
  The time series' are divided in time with no overlap, and are balanced.
  
  By splitting the time series', the number of samples in the data set is changed and so new
  arrays for the data and target are returned by the ``split`` function in addition to the
  iterator.
  
  Parameters
  ----------
  n_splits : int > 1
      number of folds
  
  Examples
  --------
  >>> from seglearn.split import TemporalKFold
  >>> from seglearn.datasets import load_watch
  >>> data = load_watch()
  >>> splitter = TemporalKFold(n_splits=4)
  >>> X, y, cv = splitter.split(data['X'], data['y'])
class_docstr_tok: ["K-fold","iterator","variant","for","temporal","splitting","of","time","series","data","The","time","series","'","are","divided","in","time","with","no","overlap",",","and","are","balanced",".","By","splitting","the","time","series","'",",","the","number","of","samples","in","the","data","set","is","changed","and","so","new","arrays","for","the","data","and","target","are","returned","by","the","``","split","``","function","in","addition","to","the","iterator",".","Parameters","--","--","--","--","--","n_splits",":","int",">","1","number","of","folds","Examples","--","--","--","--",">",">",">","from","seglearn.split","import","TemporalKFold",">",">",">","from","seglearn.datasets","import","load_watch",">",">",">","data","=","load_watch","(",")",">",">",">","splitter","=","TemporalKFold","(","n_splits=4",")",">",">",">","X",",","y",",","cv","=","splitter.split","(","data","[","'","X","'","]",",","data","[","'","y","'","]",")"]
docstr: Splits time series data and target arrays, and generates splitting indices
  
  Parameters
  ----------
  X : array-like, shape [n_series, ...]
     Time series data and (optionally) contextual data
  y : array-like shape [n_series, ]
      target vector
  
  Returns
  -------
  X : array-like, shape [n_series * n_splits, ]
      Split time series data and contextual data
  y : array-like, shape [n_series * n_splits]
      Split target data
  cv : list, shape [2, n_splits]
      Splitting indices
docstr_tok: ["Splits","time","series","data","and","target","arrays",",","and","generates","splitting","indices","Parameters","--","--","--","--","--","X",":","array-like",",","shape","[","n_series",",","...","]","Time","series","data","and","(","optionally",")","contextual","data","y",":","array-like","shape","[","n_series",",","]","target","vector","Returns","--","--","--","-","X",":","array-like",",","shape","[","n_series","*","n_splits",",","]","Split","time","series","data","and","contextual","data","y",":","array-like",",","shape","[","n_series","*","n_splits","]","Split","target","data","cv",":","list",",","shape","[","2",",","n_splits","]","Splitting","indices"]
code: def split(self, X, y):
      """
      Splits time series data and target arrays, and generates splitting indices
  
      Parameters
      ----------
      X : array-like, shape [n_series, ...]
         Time series data and (optionally) contextual data
      y : array-like shape [n_series, ]
          target vector
  
      Returns
      -------
      X : array-like, shape [n_series * n_splits, ]
          Split time series data and contextual data
      y : array-like, shape [n_series * n_splits]
          Split target data
      cv : list, shape [2, n_splits]
          Splitting indices
      """
  
      check_ts_data(X, y)
      Xt, Xc = get_ts_data_parts(X)
      Ns = len(Xt)
      Xt_new, y_new = self._ts_slice(Xt, y)
  
      if Xc is not None:
          Xc_new = np.concatenate([Xc] * self.n_splits)
          X_new = TS_Data(Xt_new, Xc_new)
      else:
          X_new = np.array(Xt_new)
  
      cv = self._make_indices(Ns)
  
      return X_new, y_new, cv
  
file_path: seglearn/seglearn/split.py
imports: import numpy
  from sklearn.model_selection._split import _build_repr
  from .util import check_ts_data, get_ts_data_parts
  from .base import TS_Data
label_desc: Use image node_id 3 for calling the TemporalKFold obj's underlying member method code with example usage: obj.split(X, y) and returns: X_new,  y_new,  cv