docstr: Rich Caruana's ensemble selection method.
docstr_tok: ["Rich","Caruana","'s","ensemble","selection","method","."]
code: def _slow(
      self,
      predictions: List[np.ndarray],
      labels: np.ndarray,
      *,
      X_data: SUPPORTED_FEAT_TYPES | None = None,
  ) -> None:
      """Rich Caruana's ensemble selection method."""
      self.num_input_models_ = len(predictions)
  
      ensemble = []
      trajectory = []
      order = []
  
      ensemble_size = self.ensemble_size
  
      for i in range(ensemble_size):
          losses = np.zeros(
              [np.shape(predictions)[0]],
              dtype=np.float64,
          )
          for j, pred in enumerate(predictions):
              ensemble.append(pred)
              ensemble_prediction = np.mean(np.array(ensemble), axis=0)
              losses[j] = calculate_losses(
                  solution=labels,
                  prediction=ensemble_prediction,
                  task_type=self.task_type,
                  metrics=[self.metric],
                  X_data=X_data,
                  scoring_functions=None,
              )[self.metric.name]
              ensemble.pop()
          best = np.nanargmin(losses)
          ensemble.append(predictions[best])
          trajectory.append(losses[best])
          order.append(best)
  
          # Handle special case
          if len(predictions) == 1:
              break
  
      self.indices_ = np.array(
          order,
          dtype=np.int64,
      )
      self.trajectory_ = np.array(
          trajectory,
          dtype=np.float64,
      )
      self.train_loss_ = trajectory[-1]
  
imports: from __future__ import annotations
  from typing import Dict, List, Sequence, Tuple, Union
  import random
  import warnings
  from collections import Counter
  import numpy
  from sklearn.utils import check_random_state
  from autosklearn.automl_common.common.utils.backend import Backend
  from autosklearn.constants import TASK_TYPES
  from autosklearn.data.validation import SUPPORTED_FEAT_TYPES
  from autosklearn.ensemble_building.run import Run
  from autosklearn.ensembles.abstract_ensemble import AbstractEnsemble
  from autosklearn.metrics import Scorer, calculate_losses
  from autosklearn.pipeline.base import BasePipeline
label_desc: Use image node_id 5 for calling the EnsembleSelection obj's underlying member method code with example usage: obj._slow(predictions, labels) without return types