class_docstr: Custom version ``LeaveOneGroupOut`` cross-validation iterator.
  
  This version only outputs indices of instances with IDs in a prespecified set.
  
  Parameters
  ----------
  keep : Iterable[IdType]
      A set of IDs to keep.
  example_ids : numpy.ndarray, of length n_samples
      A list of example IDs.
  logger : Optional[logging.Logger], default=None
      A logger instance.
docstr: Generate indices to split data into training and test set.
  
  Parameters
  ----------
  X : numpy.ndarray, with shape (n_samples, n_features)
      Training data, where n_samples is the number of samples
      and n_features is the number of features.
  y : numpy.ndarray, of length n_samples
      The target variable for supervised learning problems.
  groups : List[str]
      Group labels for the samples used while splitting the dataset into
      train/test set.
  
  Yields
  ------
  train_index : numpy.ndarray
      The training set indices for that split.
  test_index : numpy.ndarray
      The testing set indices for that split.
docstr_tok: ["Generate","indices","to","split","data","into","training","and","test","set",".","Parameters","--","--","--","--","--","X",":","numpy.ndarray",",","with","shape","(","n_samples",",","n_features",")","Training","data",",","where","n_samples","is","the","number","of","samples","and","n_features","is","the","number","of","features",".","y",":","numpy.ndarray",",","of","length","n_samples","The","target","variable","for","supervised","learning","problems",".","groups",":","List","[","str","]","Group","labels","for","the","samples","used","while","splitting","the","dataset","into","train\/test","set",".","Yields","--","--","--","train_index",":","numpy.ndarray","The","training","set","indices","for","that","split",".","test_index",":","numpy.ndarray","The","testing","set","indices","for","that","split","."]
code: def split(
      self,
      X: SparseFeatureMatrix,
      y: np.ndarray,
      groups: Optional[List[str]],
  ) -> IndexIterator:
      """
      Generate indices to split data into training and test set.
  
      Parameters
      ----------
      X : numpy.ndarray, with shape (n_samples, n_features)
          Training data, where n_samples is the number of samples
          and n_features is the number of features.
      y : numpy.ndarray, of length n_samples
          The target variable for supervised learning problems.
      groups : List[str]
          Group labels for the samples used while splitting the dataset into
          train/test set.
  
      Yields
      ------
      train_index : numpy.ndarray
          The training set indices for that split.
      test_index : numpy.ndarray
          The testing set indices for that split.
      """
      for train_index, test_index in super(
          FilteredLeaveOneGroupOut, self
      ).split(X, y, groups):
          train_len = len(train_index)
          test_len = len(test_index)
          train_index = [
              i for i in train_index if self.example_ids[i] in self.keep
          ]
          test_index = [
              i for i in test_index if self.example_ids[i] in self.keep
          ]
          if not self._warned and (
              train_len != len(train_index)
              or test_len != len(test_index)
          ):
              self.logger.warning(
                  "Feature set contains IDs that are not "
                  "in folds dictionary. Skipping those IDs."
              )
              self._warned = True
  
          yield train_index, test_index
  
imports: from __future__ import annotations
  import inspect
  import logging
  import sys
  import time
  from collections import Counter, defaultdict
  from csv import DictWriter, excel_tab
  from functools import wraps
  from importlib import import_module
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple, Type, Union
  import joblib
  import numpy
  import scipy.sparse
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.feature_selection import SelectKBest
  from sklearn.metrics import accuracy_score, confusion_matrix, precision_recall_fscore_support
  from sklearn.model_selection import KFold, LeaveOneGroupOut, ShuffleSplit, StratifiedKFold
  from skll.data import FeatureSet
  from skll.metrics import _CUSTOM_METRICS, _PREDEFINED_CUSTOM_METRICS, use_score_func
  from skll.types import ComputeEvalMetricsResults, ConfusionMatrix, FeaturesetIterator, FoldMapping, IdType, IndexIterator, LabelType, PathOrStr, SparseFeatureMatrix
  from skll.utils.constants import CLASSIFICATION_ONLY_METRICS, CORRELATION_METRICS, REGRESSION_ONLY_METRICS, UNWEIGHTED_KAPPA_METRICS, WEIGHTED_KAPPA_METRICS
  from skll.version import VERSION
label_desc: Use image node_id 2 for calling the FilteredLeaveOneGroupOut obj's underlying member method code with example usage: obj.split(X, y, groups) without return types