class_docstr: KStepAhead cross validation iterator:
  Provides fit/test indexes to split data in sequential sets
code: def __iter__(self):
      n = self.n
      k = self.k
      start = self.start
      if self.return_slice:
          for i in range(start, n - k):
              train_slice = slice(None, i, None)
              if self.kall:
                  test_slice = slice(i, i + k)
              else:
                  test_slice = slice(i + k - 1, i + k)
              yield train_slice, test_slice
  
      else:  # for compatibility with other iterators
          for i in range(start, n - k):
              train_index = np.zeros(n, dtype=bool)
              train_index[:i] = True
              test_index = np.zeros(n, dtype=bool)
              if self.kall:
                  test_index[
                      i : i + k
                  ] = True  # np.logical_not(test_index)
              else:
                  test_index[i + k - 1 : i + k] = True
              # or faster to return np.arange(i,i+k) ?
              # returning slice should be faster in this case
              yield train_index, test_index
  
imports: from statsmodels.compat.python import lrange
  import numpy
  from itertools import combinations
label_desc: Use image node_id 2 for calling the KStepAhead obj's underlying member method code with example usage: obj.__iter__() without return types