class_docstr: KlusterFold cross validator. Create folds based on provided cluster method
  
  Parameters
  ----------
  cluster_method : Clusterer
      Clustering method to use for the fold validation.
class_docstr_tok: ["KlusterFold","cross","validator",".","Create","folds","based","on","provided","cluster","method","Parameters","--","--","--","--","--","cluster_method",":","Clusterer","Clustering","method","to","use","for","the","fold","validation","."]
docstr: Generate indices to split data into training and test set.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features)
      Array to split on.
  y : array-like of shape (n_samples,) | None, default=None
      Ignored, present for compatibility.
  groups : array-like of shape (n_samples,) | None, default=None
      Ignored, present for compatibility.
  
  Yields
  -------
  tuple[np.ndarray, np.ndarray]
      Train and test indices of the same fold.
docstr_tok: ["Generate","indices","to","split","data","into","training","and","test","set",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","Array","to","split","on",".","y",":","array-like","of","shape","(","n_samples",",",")","|","None",",","default=None","Ignored",",","present","for","compatibility",".","groups",":","array-like","of","shape","(","n_samples",",",")","|","None",",","default=None","Ignored",",","present","for","compatibility",".","Yields","--","--","--","-","tuple","[","np.ndarray",",","np.ndarray","]","Train","and","test","indices","of","the","same","fold","."]
code: def split(self, X, y=None, groups=None):
      """Generate indices to split data into training and test set.
  
      Parameters
      ----------
      X : array-like of shape (n_samples, n_features)
          Array to split on.
      y : array-like of shape (n_samples,) | None, default=None
          Ignored, present for compatibility.
      groups : array-like of shape (n_samples,) | None, default=None
          Ignored, present for compatibility.
  
      Yields
      -------
      tuple[np.ndarray, np.ndarray]
          Train and test indices of the same fold.
      """
  
      X = check_array(X)
  
      if not self._method_is_fitted(X):
          self.cluster_method.fit(X)
      clusters = self.cluster_method.predict(X)
  
      self.n_splits = len(np.unique(clusters))
  
      if self.n_splits < 2:
          raise ValueError(
              f"Clustering method resulted in {self.n_splits} cluster, too few for fold validation"
          )
  
      for label in np.unique(clusters):
          yield (
              np.where(clusters != label)[0],
              np.where(clusters == label)[0],
          )
  
imports: import numbers
  from datetime import timedelta
  from itertools import combinations
  from warnings import warn
  import numpy
  import pandas
  from sklearn.exceptions import NotFittedError
  from sklearn.model_selection._split import _BaseKFold, check_array
  from sklearn.utils.validation import indexable
  from sklego.base import Clusterer
  from sklego.common import sliding_window
label_desc: Use image node_id 2 for calling the KlusterFoldValidation obj's underlying member method code with example usage: obj.split(X, y, groups) without return types