class_docstr: Flexible splitter for time-series cross validation and rolling window evaluation.
  Suitable for use in GridSearchCV.
  
  Attributes
  ----------
  min_splits : int
      Guaranteed min number of splits. This is always set to 1. If provided configuration results in 0 splits,
      the cross validator will yield a default split.
  
  __starting_test_index : int
      Test end index of the first CV split. Actual offset = __starting_test_index + _get_offset(X), for a particular
      dataset X.
      Cross validator ensures the last test split contains the last observation in X.
  
  Examples
  --------
  >>> from greykite.sklearn.cross_validation import RollingTimeSeriesSplit
  >>> X = np.random.rand(20, 4)
  >>> tscv = RollingTimeSeriesSplit(forecast_horizon=3, max_splits=4)
  >>> tscv.get_n_splits(X=X)
  4
  >>> for train, test in tscv.split(X=X):
  ...     print(train, test)
  [2 3 4 5 6 7] [ 8  9 10]
  [ 5  6  7  8  9 10] [11 12 13]
  [ 8  9 10 11 12 13] [14 15 16]
  [11 12 13 14 15 16] [17 18 19]
  >>> X = np.random.rand(20, 4)
  >>> tscv = RollingTimeSeriesSplit(forecast_horizon=2,
  ...                               min_train_periods=4,
  ...                               expanding_window=True,
  ...                               periods_between_splits=4,
  ...                               periods_between_train_test=2,
  ...                               max_splits=None)
  >>> tscv.get_n_splits(X=X)
  4
  >>> for train, test in tscv.split(X=X):
  ...     print(train, test)
  [0 1 2 3] [6 7]
  [0 1 2 3 4 5 6 7] [10 11]
  [ 0  1  2  3  4  5  6  7  8  9 10 11] [14 15]
  [ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15] [18 19]
  >>> X = np.random.rand(5, 4)  # default split if there is not enough data
  >>> for train, test in tscv.split(X=X):
  ...     print(train, test)
  [0 1 2 3] [4]
class_docstr_tok: ["Flexible","splitter","for","time-series","cross","validation","and","rolling","window","evaluation",".","Suitable","for","use","in","GridSearchCV",".","Attributes","--","--","--","--","--","min_splits",":","int","Guaranteed","min","number","of","splits",".","This","is","always","set","to","1",".","If","provided","configuration","results","in","0","splits",",","the","cross","validator","will","yield","a","default","split",".","__starting_test_index",":","int","Test","end","index","of","the","first","CV","split",".","Actual","offset","=","__starting_test_index","+","_get_offset","(","X",")",",","for","a","particular","dataset","X",".","Cross","validator","ensures","the","last","test","split","contains","the","last","observation","in","X",".","Examples","--","--","--","--",">",">",">","from","greykite.sklearn.cross_validation","import","RollingTimeSeriesSplit",">",">",">","X","=","np.random.rand","(","20",",","4",")",">",">",">","tscv","=","RollingTimeSeriesSplit","(","forecast_horizon=3",",","max_splits=4",")",">",">",">","tscv.get_n_splits","(","X=X",")","4",">",">",">","for","train",",","test","in","tscv.split","(","X=X",")",":","...","print","(","train",",","test",")","[","2","3","4","5","6","7","]","[","8","9","10","]","[","5","6","7","8","9","10","]","[","11","12","13","]","[","8","9","10","11","12","13","]","[","14","15","16","]","[","11","12","13","14","15","16","]","[","17","18","19","]",">",">",">","X","=","np.random.rand","(","20",",","4",")",">",">",">","tscv","=","RollingTimeSeriesSplit","(","forecast_horizon=2",",","...","min_train_periods=4",",","...","expanding_window=True",",","...","periods_between_splits=4",",","...","periods_between_train_test=2",",","...","max_splits=None",")",">",">",">","tscv.get_n_splits","(","X=X",")","4",">",">",">","for","train",",","test","in","tscv.split","(","X=X",")",":","...","print","(","train",",","test",")","[","0","1","2","3","]","[","6","7","]","[","0","1","2","3","4","5","6","7","]","[","10","11","]","[","0","1","2","3","4","5","6","7","8","9","10","11","]","[","14","15","]","[","0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","]","[","18","19","]",">",">",">","X","=","np.random.rand","(","5",",","4",")","#","default","split","if","there","is","not","enough","data",">",">",">","for","train",",","test","in","tscv.split","(","X=X",")",":","...","print","(","train",",","test",")","[","0","1","2","3","]","[","4","]"]
docstr: Returns the number of splitting iterations in the cross-validator as configured, ignoring
      self.max_splits and self.min_splits
  
  Parameters
  ----------
  X : array-like, shape (n_samples, n_features)
      Input data to split
  
  Returns
  -------
  n_splits : int
      The number of splitting iterations in the cross-validator as configured, ignoring
      self.max_splits and self.min_splits
docstr_tok: ["Returns","the","number","of","splitting","iterations","in","the","cross-validator","as","configured",",","ignoring","self.max_splits","and","self.min_splits","Parameters","--","--","--","--","--","X",":","array-like",",","shape","(","n_samples",",","n_features",")","Input","data","to","split","Returns","--","--","--","-","n_splits",":","int","The","number","of","splitting","iterations","in","the","cross-validator","as","configured",",","ignoring","self.max_splits","and","self.min_splits"]
code: def get_n_splits_without_capping(self, X=None):
      """Returns the number of splitting iterations in the cross-validator as configured, ignoring
          self.max_splits and self.min_splits
  
      Parameters
      ----------
      X : array-like, shape (n_samples, n_features)
          Input data to split
  
      Returns
      -------
      n_splits : int
          The number of splitting iterations in the cross-validator as configured, ignoring
          self.max_splits and self.min_splits
      """
      last_index = X.shape[0] - 1
      starting_index = self.__starting_test_index + self._get_offset(
          X=X
      )
      if starting_index > last_index:
          return 0
      return math.ceil(
          (last_index - starting_index + 1)
          / self.periods_between_splits
      )
  
file_path: greykite/greykite/sklearn/cross_validation.py
imports: import math
  import random
  import warnings
  import numpy
  from sklearn.model_selection import BaseCrossValidator
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
  from greykite.common.python_utils import get_integer
label_desc: Use image node_id 4 for calling the RollingTimeSeriesSplit obj's underlying member method code with example usage: obj.get_n_splits_without_capping(X) and returns: math, int