class_docstr: A model bridge for using models based on discrete parameters.
  
  Requires that all parameters have been transformed to ChoiceParameters.
class_docstr_tok: ["A","model","bridge","for","using","models","based","on","discrete","parameters",".","Requires","that","all","parameters","have","been","transformed","to","ChoiceParameters","."]
docstr: Make predictions at cv_test_points using only the data in obs_feats
  and obs_data.
docstr_tok: ["Make","predictions","at","cv_test_points","using","only","the","data","in","obs_feats","and","obs_data","."]
code: def _cross_validate(
      self,
      search_space: SearchSpace,
      cv_training_data: List[Observation],
      cv_test_points: List[ObservationFeatures],
  ) -> List[ObservationData]:
      """Make predictions at cv_test_points using only the data in obs_feats
      and obs_data.
      """
      observation_features, observation_data = separate_observations(
          cv_training_data
      )
      Xs_train, Ys_train, Yvars_train = self._convert_observations(
          observation_data=observation_data,
          observation_features=observation_features,
          outcomes=self.outcomes,
          parameters=self.parameters,
      )
      X_test = [
          [obsf.parameters[param] for param in self.parameters]
          for obsf in cv_test_points
      ]
      # Use the model to do the cross validation
      f_test, cov_test = self.model.cross_validate(
          Xs_train=Xs_train,
          Ys_train=Ys_train,
          Yvars_train=Yvars_train,
          X_test=X_test,
      )
      # Convert array back to ObservationData
      return array_to_observation_data(
          f=f_test, cov=cov_test, outcomes=self.outcomes
      )
  
imports: from typing import Dict, List, Optional, Set, Tuple
  from ax.core.observation import Observation, ObservationData, ObservationFeatures, separate_observations
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.parameter import ChoiceParameter, FixedParameter
  from ax.core.search_space import SearchSpace
  from ax.core.types import TParamValueList
  from ax.exceptions.core import UserInputError
  from ax.modelbridge.base import GenResults, ModelBridge
  from ax.modelbridge.modelbridge_utils import array_to_observation_data, get_fixed_features
  from ax.modelbridge.torch import extract_objective_weights, extract_outcome_constraints, validate_optimization_config
  from ax.models.discrete_base import DiscreteModel
  from ax.models.types import TConfig
label_desc: Use image node_id 5 for calling the DiscreteModelBridge obj's underlying member method code with example usage: obj._cross_validate(search_space, cv_training_data, cv_test_points) and returns: array_to_observation_data