class_docstr: MVaR Approximation based on Random Scalarizations as introduced
  in [Daulton2022MARS]_.
  
  This approximates MVaR via VaR of Chebyshev scalarizations, where each
  scalarization corresponds to a point in the MVaR set. As implemented,
  this uses one set of scalarization weights to approximate a single MVaR value.
  Note that due to the normalization within the Chebyshev scalarization,
  the output of this risk measure may not be on the same scale as its inputs.
docstr: Transform the posterior samples to samples of a risk measure.
  
  Args:
      alpha: The risk level, float in `(0.0, 1.0]`.
      n_w: The size of the perturbation set to calculate the risk measure over.
      chebyshev_weights: The weights to use in the Chebyshev scalarization.
          The Chebyshev scalarization is applied before computing VaR.
          The weights must be non-negative. See `preprocessing_function` to
          support minimization objectives.
      baseline_Y: An `n' x d`-dim tensor of baseline outcomes to use in
          determining the normalization bounds for Chebyshev scalarization.
          It is recommended to set this via `set_baseline_Y` helper.
      ref_point: An optional MVaR reference point to use in determining
          the normalization bounds for Chebyshev scalarization.
      preprocessing_function: A preprocessing function to apply to the
          samples before computing the risk measure. This can be used to
          remove non-objective outcomes or to align all outcomes for
          maximization. For constrained optimization, this should also
          apply feasibility-weighting to samples.
docstr_tok: ["Transform","the","posterior","samples","to","samples","of","a","risk","measure",".","Args",":","alpha",":","The","risk","level",",","float","in","`","(","0.0",",","1.0","]","`",".","n_w",":","The","size","of","the","perturbation","set","to","calculate","the","risk","measure","over",".","chebyshev_weights",":","The","weights","to","use","in","the","Chebyshev","scalarization",".","The","Chebyshev","scalarization","is","applied","before","computing","VaR",".","The","weights","must","be","non-negative",".","See","`","preprocessing_function","`","to","support","minimization","objectives",".","baseline_Y",":","An","`","n","'","x","d","`","-dim","tensor","of","baseline","outcomes","to","use","in","determining","the","normalization","bounds","for","Chebyshev","scalarization",".","It","is","recommended","to","set","this","via","`","set_baseline_Y","`","helper",".","ref_point",":","An","optional","MVaR","reference","point","to","use","in","determining","the","normalization","bounds","for","Chebyshev","scalarization",".","preprocessing_function",":","A","preprocessing","function","to","apply","to","the","samples","before","computing","the","risk","measure",".","This","can","be","used","to","remove","non-objective","outcomes","or","to","align","all","outcomes","for","maximization",".","For","constrained","optimization",",","this","should","also","apply","feasibility-weighting","to","samples","."]
code: def __init__(
      self,
      alpha: float,
      n_w: int,
      chebyshev_weights: Union[Tensor, List[float]],
      baseline_Y: Optional[Tensor] = None,
      ref_point: Optional[Union[Tensor, List[float]]] = None,
      preprocessing_function: Optional[
          Callable[[Tensor], Tensor]
      ] = None,
  ) -> None:
      r"""Transform the posterior samples to samples of a risk measure.
  
      Args:
          alpha: The risk level, float in `(0.0, 1.0]`.
          n_w: The size of the perturbation set to calculate the risk measure over.
          chebyshev_weights: The weights to use in the Chebyshev scalarization.
              The Chebyshev scalarization is applied before computing VaR.
              The weights must be non-negative. See `preprocessing_function` to
              support minimization objectives.
          baseline_Y: An `n' x d`-dim tensor of baseline outcomes to use in
              determining the normalization bounds for Chebyshev scalarization.
              It is recommended to set this via `set_baseline_Y` helper.
          ref_point: An optional MVaR reference point to use in determining
              the normalization bounds for Chebyshev scalarization.
          preprocessing_function: A preprocessing function to apply to the
              samples before computing the risk measure. This can be used to
              remove non-objective outcomes or to align all outcomes for
              maximization. For constrained optimization, this should also
              apply feasibility-weighting to samples.
      """
      if preprocessing_function is None:
          preprocessing_function = IdentityMCMultiOutputObjective()
      super().__init__(
          alpha=alpha,
          n_w=n_w,
          preprocessing_function=preprocessing_function,
      )
      self.chebyshev_weights = torch.as_tensor(chebyshev_weights)
      self.baseline_Y = baseline_Y
      self.register_buffer(
          "ref_point",
          torch.as_tensor(ref_point) if ref_point is not None else None,
      )
      self.mvar = MVaR(n_w=self.n_w, alpha=self.alpha)
      self._chebyshev_objective = None
  
imports: import warnings
  from abc import ABC, abstractmethod
  from math import ceil
  from typing import Callable, List, Optional, Union
  import torch
  from botorch.acquisition.multi_objective.objective import IdentityMCMultiOutputObjective, MCMultiOutputObjective
  from botorch.acquisition.risk_measures import CVaR, RiskMeasureMCObjective, VaR
  from botorch.exceptions.errors import UnsupportedError
  from botorch.exceptions.warnings import BotorchWarning
  from botorch.models.model import Model
  from botorch.utils.multi_objective.pareto import is_non_dominated
  from botorch.utils.transforms import normalize
  from torch import Tensor
label_desc: Use image node_id 1 to create a new MARS object from inherited base classes: VaR, MultiOutputRiskMeasureMCObjective with example: obj = MARS(alpha, n_w, chebyshev_weights, baseline_Y, ref_point, preprocessing_function)