class_docstr: Convert categorical parameters (unordered ChoiceParameters) to
  one-hot-encoded parameters.
  
  Does not convert task parameters.
  
  Parameters will be one-hot-encoded, yielding a set of RangeParameters,
  of type float, on [0, 1]. If there are two values, one single RangeParameter
  will be yielded, otherwise there will be a new RangeParameter for each
  ChoiceParameter value.
  
  In the reverse transform, floats can be converted to a one-hot encoded vector
  using one of two methods:
  
  Strict rounding: Choose the maximum value. With levels ['a', 'b', 'c'] and
      float values [0.2, 0.4, 0.3], the restored parameter would be set to 'b'.
      Ties are broken randomly, so values [0.2, 0.4, 0.4] is randomly set to 'b'
      or 'c'.
  
  Randomized rounding: Sample from the distribution. Float values
      [0.2, 0.4, 0.3] are transformed to 'a' w.p.
      0.2/0.9, 'b' w.p. 0.4/0.9, or 'c' w.p. 0.3/0.9.
  
  Type of rounding can be set using transform_config['rounding'] to either
  'strict' or 'randomized'. Defaults to strict.
  
  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, encoder in self.encoder.items():
              if p_name in obsf.parameters:
                  vals = encoder.transform(
                      labels=[obsf.parameters.pop(p_name)]
                  )[0]
                  updated_parameters: TParameterization = {
                      self.encoded_parameters[p_name][i]: v
                      for i, v in enumerate(vals)
                  }
                  obsf.parameters.update(updated_parameters)
      return observation_features
  
imports: from typing import Dict, List, Optional, TYPE_CHECKING, TypeVar
  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 TParameterization
  from ax.modelbridge.transforms.base import Transform
  from ax.modelbridge.transforms.rounding import randomized_onehot_round, strict_onehot_round
  from ax.modelbridge.transforms.utils import construct_new_search_space
  from ax.models.types import TConfig
  from sklearn.preprocessing import LabelBinarizer, LabelEncoder
label_desc: Use image node_id 2 for calling the OneHot obj's underlying member method code with example usage: obj.transform_observation_features(observation_features) and returns: observation_features