class_docstr: A class for defining risk measures.
  
  This can be used with a `RobustSearchSpace`, to convert the predictions over
  `ParameterDistribution`s to robust metrics, which then get used in candidate
  generation to recommend robust candidates.
  
  See `ax/modelbridge/modelbridge_utils.py` for `RISK_MEASURE_NAME_TO_CLASS`,
  which lists the supported risk measures, and for `extract_risk_measure`
  helper, which extracts the BoTorch risk measure.
class_docstr_tok: ["A","class","for","defining","risk","measures",".","This","can","be","used","with","a","`","RobustSearchSpace","`",",","to","convert","the","predictions","over","`","ParameterDistribution","`","s","to","robust","metrics",",","which","then","get","used","in","candidate","generation","to","recommend","robust","candidates",".","See","`","ax\/modelbridge\/modelbridge_utils.py","`","for","`","RISK_MEASURE_NAME_TO_CLASS","`",",","which","lists","the","supported","risk","measures",",","and","for","`","extract_risk_measure","`","helper",",","which","extracts","the","BoTorch","risk","measure","."]
docstr: Initialize a risk measure.
  
  Args:
      risk_measure: The name of the risk measure to use. This should have a
          corresponding entry in `RISK_MEASURE_NAME_TO_CLASS`.
      options: A dictionary of keyword arguments for initializing the risk
          measure. Except for MARS, the risk measure will be initialized as
          `RISK_MEASURE_NAME_TO_CLASS[risk_measure](**options)`. For MARS,
          additional attributes are needed to inform the scalarization.
docstr_tok: ["Initialize","a","risk","measure",".","Args",":","risk_measure",":","The","name","of","the","risk","measure","to","use",".","This","should","have","a","corresponding","entry","in","`","RISK_MEASURE_NAME_TO_CLASS","`",".","options",":","A","dictionary","of","keyword","arguments","for","initializing","the","risk","measure",".","Except","for","MARS",",","the","risk","measure","will","be","initialized","as","`","RISK_MEASURE_NAME_TO_CLASS","[","risk_measure","]","(","*","*","options",")","`",".","For","MARS",",","additional","attributes","are","needed","to","inform","the","scalarization","."]
code: def __init__(
      self,
      risk_measure: str,
      options: Dict[str, Union[int, float, bool, List[float]]],
  ) -> None:
      """Initialize a risk measure.
  
      Args:
          risk_measure: The name of the risk measure to use. This should have a
              corresponding entry in `RISK_MEASURE_NAME_TO_CLASS`.
          options: A dictionary of keyword arguments for initializing the risk
              measure. Except for MARS, the risk measure will be initialized as
              `RISK_MEASURE_NAME_TO_CLASS[risk_measure](**options)`. For MARS,
              additional attributes are needed to inform the scalarization.
      """
      super().__init__()
      self.risk_measure = risk_measure
      self.options = options
  
file_path: Ax/ax/core/risk_measures.py
imports: from __future__ import annotations
  from copy import deepcopy
  from typing import Dict, List, Union
  from ax.utils.common.base import SortableBase
  from ax.utils.common.equality import equality_typechecker
label_desc: Use image node_id 1 to create a new RiskMeasure object from inherited base classes: SortableBase with example: obj = RiskMeasure(risk_measure, options)