docstr: k-fold cross-validation
  
  In k-fold cross-validation, the original sample is randomly partitioned into
  k equal sized subsamples. Of the k subsamples, a single subsample is retained as
  the validation data for testing the model, and the remaining k − 1 subsamples are
  used as training data. The cross-validation process is then repeated k times (the folds),
  with each of the k subsamples used exactly once as the validation data.
  
  The k results from the folds can then be averaged (or otherwise combined) to produce a
  single estimation. Reference: https://en.wikipedia.org/wiki/Cross-validation_(statistics)
  
  :param shuffle:
  :type shuffle:
  
  :param random_state:
  :type random_state:
  
  :return:
code: def k_fold_cross_validation(self, shuffle=True, random_state=None):
      """
      k-fold cross-validation
  
      In k-fold cross-validation, the original sample is randomly partitioned into
      k equal sized subsamples. Of the k subsamples, a single subsample is retained as
      the validation data for testing the model, and the remaining k − 1 subsamples are
      used as training data. The cross-validation process is then repeated k times (the folds),
      with each of the k subsamples used exactly once as the validation data.
  
      The k results from the folds can then be averaged (or otherwise combined) to produce a
      single estimation. Reference: https://en.wikipedia.org/wiki/Cross-validation_(statistics)
  
      :param shuffle:
      :type shuffle:
  
      :param random_state:
      :type random_state:
  
      :return:
      """
  
      kfold = KFold(
          n_splits=self.n_splits,
          shuffle=shuffle,
          random_state=random_state,
      )
      trained_model = list(kfold.split(self.df))
  
      if self.dir_folds is not None:
          self.write_files(trained_model)
  
file_path: CaseRecommender/caserec/utils/split_database.py
imports: from sklearn.model_selection import KFold, ShuffleSplit
  import os
  from caserec.utils.process_data import ReadFile, WriteFile
label_desc: Use image node_id 4 for calling the SplitDatabase obj's underlying member method code with example usage: obj.k_fold_cross_validation(shuffle, random_state) without return types