class_docstr: Map Y values to percentiles based on their empirical CDF.
class_docstr_tok: ["Map","Y","values","to","percentiles","based","on","their","empirical","CDF","."]
code: def __init__(
      self,
      search_space: Optional[SearchSpace] = None,
      observations: Optional[List[Observation]] = None,
      modelbridge: Optional[
          "modelbridge_module.base.ModelBridge"
      ] = None,
      config: Optional[TConfig] = None,
  ) -> None:
      assert (
          observations is not None
      ), "PercentileY requires observations"
      if len(observations) == 0:
          raise DataRequiredError(
              "Percentile transform requires non-empty data."
          )
      observation_data = [obs.data for obs in observations]
      metric_values = get_data(observation_data=observation_data)
      # pyre-fixme[4]: Attribute must be annotated.
      self.percentiles = {
          metric_name: vals
          for metric_name, vals in metric_values.items()
      }
      if config is not None and "winsorize" in config:
          # pyre-fixme[4]: Attribute must be annotated.
          self.winsorize = checked_cast(
              bool, (config.get("winsorize") or False)
          )
      else:
          self.winsorize = False
  
file_path: Ax/ax/modelbridge/transforms/percentile_y.py
imports: import math
  from logging import Logger
  from typing import List, Optional, TYPE_CHECKING
  from ax.core.observation import Observation, ObservationData
  from ax.core.search_space import SearchSpace
  from ax.exceptions.core import DataRequiredError
  from ax.modelbridge.transforms.base import Transform
  from ax.modelbridge.transforms.utils import get_data
  from ax.models.types import TConfig
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import checked_cast
  from scipy import stats
label_desc: Use image node_id 1 to create a new PercentileY object from inherited base classes: Transform with example: obj = PercentileY(search_space, observations, modelbridge, config)