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 _map(self, val: float, metric_name: str) -> float:
      vals = self.percentiles[metric_name]
      mapped_val = (
          stats.percentileofscore(vals, val, kind="weak") / 100.0
      )
      return mapped_val
  
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 3 for calling the PercentileY obj's underlying member method code with example usage: obj._map(val, metric_name) and returns: mapped_val