code: def _gl_init_pred(y_pred, X, n_train):
      """Aux. function to GeneralizingEstimator to initialize y_pred."""
      n_sample, n_iter = X.shape[0], X.shape[-1]
      if y_pred.ndim == 3:
          y_pred = np.zeros(
              (n_sample, n_train, n_iter, y_pred.shape[-1]),
              y_pred.dtype,
          )
      else:
          y_pred = np.zeros((n_sample, n_train, n_iter), y_pred.dtype)
      return y_pred
  
imports: import logging
  import numpy
  from ..fixes import _get_check_scoring
  from ..parallel import parallel_func
  from ..utils import ProgressBar, _parse_verbose, array_split_idx, fill_doc, verbose
  from .base import BaseEstimator, _check_estimator
  from .mixin import TransformerMixin
label_desc: Use image node_id 7 for calling a global function with example usage: _gl_init_pred(y_pred, X, n_train) and returns: y_pred