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","."]
code: def _fit(
      self,
      model: DiscreteModel,
      search_space: SearchSpace,
      observations: List[Observation],
  ) -> None:
      self.model = model
      # Convert observations to arrays
      self.parameters = list(search_space.parameters.keys())
      all_metric_names: Set[str] = set()
      observation_features, observation_data = separate_observations(
          observations
      )
      for od in observation_data:
          all_metric_names.update(od.metric_names)
      self.outcomes = list(all_metric_names)
      # Convert observations to arrays
      Xs_array, Ys_array, Yvars_array = self._convert_observations(
          observation_data=observation_data,
          observation_features=observation_features,
          outcomes=self.outcomes,
          parameters=self.parameters,
      )
      # Extract parameter values
      parameter_values = _get_parameter_values(
          search_space, self.parameters
      )
      self.model.fit(
          Xs=Xs_array,
          Ys=Ys_array,
          Yvars=Yvars_array,
          parameter_values=parameter_values,
          outcome_names=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 1 for calling the DiscreteModelBridge obj's underlying member method code with example usage: obj._fit(model, search_space, observations) without return types