class_docstr: Convert general ChoiceParameters to integer or float ChoiceParameters.
  
  If the parameter type is numeric (int, float) and the parameter is ordered,
  then the values are normalized to the unit interval while retaining relative
  spacing. If the parameter type is unordered (categorical) or ordered but
  non-numeric, this transform uses an integer encoding to `0, 1, ..., n_choices - 1`.
  The resulting choice parameter will be considered ordered iff the original
  parameter is.
  
  In the inverse transform, parameters will be mapped back onto the original domain.
  
  This transform does not transform task parameters (use TaskEncode for this).
  
  Note that this behavior is different from that of OrderedChoiceEncode, which
  transforms (ordered) ChoiceParameters to integer RangeParameters (rather than
  ChoiceParameters).
  
  Transform is done in-place.
class_docstr_tok: ["Convert","general","ChoiceParameters","to","integer","or","float","ChoiceParameters",".","If","the","parameter","type","is","numeric","(","int",",","float",")","and","the","parameter","is","ordered",",","then","the","values","are","normalized","to","the","unit","interval","while","retaining","relative","spacing",".","If","the","parameter","type","is","unordered","(","categorical",")","or","ordered","but","non-numeric",",","this","transform","uses","an","integer","encoding","to","`","0",",","1",",","...",",","n_choices","-","1","`",".","The","resulting","choice","parameter","will","be","considered","ordered","iff","the","original","parameter","is",".","In","the","inverse","transform",",","parameters","will","be","mapped","back","onto","the","original","domain",".","This","transform","does","not","transform","task","parameters","(","use","TaskEncode","for","this",")",".","Note","that","this","behavior","is","different","from","that","of","OrderedChoiceEncode",",","which","transforms","(","ordered",")","ChoiceParameters","to","integer","RangeParameters","(","rather","than","ChoiceParameters",")",".","Transform","is","done","in-place","."]
code: def transform_observation_features(
      self, observation_features: List[ObservationFeatures]
  ) -> List[ObservationFeatures]:
      for obsf in observation_features:
          for p_name in self.encoded_parameters:
              if p_name in obsf.parameters:
                  obsf.parameters[p_name] = self.encoded_parameters[
                      p_name
                  ][obsf.parameters[p_name]]
      return observation_features
  
file_path: Ax/ax/modelbridge/transforms/choice_encode.py
imports: from typing import Dict, List, Optional, Tuple, TYPE_CHECKING
  import numpy
  from ax.core.observation import Observation, ObservationFeatures
  from ax.core.parameter import ChoiceParameter, Parameter, ParameterType, RangeParameter
  from ax.core.search_space import SearchSpace
  from ax.core.types import TParamValue
  from ax.modelbridge.transforms.base import Transform
  from ax.modelbridge.transforms.utils import ClosestLookupDict, construct_new_search_space
  from ax.models.types import TConfig
label_desc: Use image node_id 2 for calling the ChoiceEncode obj's underlying member method code with example usage: obj.transform_observation_features(observation_features) and returns: observation_features