class_docstr: Group time series cross-validator.
  
  Parameters
  ----------
  test_size : int
      Size of test dataset.
  train_size : int (default=None)
      Size of train dataset.
  n_splits : int (default=None)
      Number of the splits.
  gap_size : int (default=0)
      Gap size between train and test datasets.
  shift_size : int (default=1)
      Step to shift for the next fold.
  window_type : str (default="rolling")
      Type of the window. Possible values: "rolling", "expanding".
  
  Examples
  -----------
  For usage examples, please see
  https://rasbt.github.io/mlxtend/user_guide/evaluate/GroupTimeSeriesSplit/
class_docstr_tok: ["Group","time","series","cross-validator",".","Parameters","--","--","--","--","--","test_size",":","int","Size","of","test","dataset",".","train_size",":","int","(","default=None",")","Size","of","train","dataset",".","n_splits",":","int","(","default=None",")","Number","of","the","splits",".","gap_size",":","int","(","default=0",")","Gap","size","between","train","and","test","datasets",".","shift_size",":","int","(","default=1",")","Step","to","shift","for","the","next","fold",".","window_type",":","str","(","default=","''","rolling","''",")","Type","of","the","window",".","Possible","values",":","``","rolling","''",",","``","expanding","''",".","Examples","--","--","--","--","--","-","For","usage","examples",",","please","see","https",":","\/\/rasbt.github.io\/mlxtend\/user_guide\/evaluate\/GroupTimeSeriesSplit\/"]
docstr: Generate indices to split data into training and test set.
  
  Parameters
  ----------
  X : array-like
      Training data.
  y : array-like (default=None)
      Always ignored, exists for compatibility.
  groups : array-like (default=None)
      Array with group names or sequence numbers.
  
  Yields
  ------
  train : ndarray
      The training set indices for that split.
  test : ndarray
      The testing set indices for that split.
docstr_tok: ["Generate","indices","to","split","data","into","training","and","test","set",".","Parameters","--","--","--","--","--","X",":","array-like","Training","data",".","y",":","array-like","(","default=None",")","Always","ignored",",","exists","for","compatibility",".","groups",":","array-like","(","default=None",")","Array","with","group","names","or","sequence","numbers",".","Yields","--","--","--","train",":","ndarray","The","training","set","indices","for","that","split",".","test",":","ndarray","The","testing","set","indices","for","that","split","."]
code: def split(self, X, y=None, groups=None):
      """Generate indices to split data into training and test set.
  
      Parameters
      ----------
      X : array-like
          Training data.
      y : array-like (default=None)
          Always ignored, exists for compatibility.
      groups : array-like (default=None)
          Array with group names or sequence numbers.
  
      Yields
      ------
      train : ndarray
          The training set indices for that split.
      test : ndarray
          The testing set indices for that split.
      """
      test_size = self.test_size
      gap = self.gap_size
      shift_size = self.shift_size
      X, y, groups = indexable(X, y, groups)
  
      if groups is None:
          raise ValueError("The groups should be specified")
  
      group_names, group_lengths = zip(
          *[
              (group_name, len(list(group_seq)))
              for group_name, group_seq in groupby(groups)
          ]
      )
      n_groups = len(group_names)
  
      if n_groups != len(set(group_names)):
          raise ValueError("The groups should be consecutive")
  
      self._n_groups = n_groups
      group_starts_idx = chain(
          [0],
          islice(accumulate(group_lengths), len(group_lengths) - 1),
      )
      groups_dict = dict(zip(group_names, group_starts_idx))
      n_samples = len(X)
  
      self._calculate_split_params()
      train_size = self.train_size
      n_splits = self.n_splits
      train_start_idx = self._train_start_idx
      train_end_idx = train_start_idx + train_size
      test_start_idx = train_end_idx + gap
      test_end_idx = test_start_idx + test_size
  
      for _ in range(n_splits):
          train_idx = np.r_[
              slice(
                  groups_dict[group_names[train_start_idx]],
                  groups_dict[group_names[train_end_idx]],
              )
          ]
  
          if test_end_idx < n_groups:
              test_idx = np.r_[
                  slice(
                      groups_dict[group_names[test_start_idx]],
                      groups_dict[group_names[test_end_idx]],
                  )
              ]
          else:
              test_idx = np.r_[
                  slice(
                      groups_dict[group_names[test_start_idx]],
                      n_samples,
                  )
              ]
  
          yield train_idx, test_idx
  
          if self.window_type == "rolling":
              train_start_idx = train_start_idx + shift_size
  
          train_end_idx = train_end_idx + shift_size
          test_start_idx = test_start_idx + shift_size
          test_end_idx = test_end_idx + shift_size
  
file_path: mlxtend/mlxtend/evaluate/time_series.py
imports: from itertools import accumulate, chain, groupby, islice
  import matplotlib.pyplot
  import numpy
  from matplotlib.patches import Patch
  from matplotlib.ticker import MaxNLocator
  from sklearn.utils import indexable
label_desc: Use image node_id 2 for calling the GroupTimeSeriesSplit obj's underlying member method code with example usage: obj.split(X, y, groups) without return types