class_docstr: A GP using a Structural Additive Contextual(SAC) kernel.
docstr: Args:
      train_X: (n x d) X training data.
      train_Y: (n x 1) Y training data.
      train_Yvar: (n x 1) Noise variances of each training Y. If None,
          we use an inferred noise likelihood.
      decomposition: Keys are context names. Values are the indexes of
          parameters belong to the context. The parameter indexes are in
          the same order across contexts.
docstr_tok: ["Args",":","train_X",":","(","n","x","d",")","X","training","data",".","train_Y",":","(","n","x","1",")","Y","training","data",".","train_Yvar",":","(","n","x","1",")","Noise","variances","of","each","training","Y",".","If","None",",","we","use","an","inferred","noise","likelihood",".","decomposition",":","Keys","are","context","names",".","Values","are","the","indexes","of","parameters","belong","to","the","context",".","The","parameter","indexes","are","in","the","same","order","across","contexts","."]
code: def __init__(
      self,
      train_X: Tensor,
      train_Y: Tensor,
      train_Yvar: Optional[Tensor],
      decomposition: Dict[str, List[int]],
  ) -> None:
      r"""
      Args:
          train_X: (n x d) X training data.
          train_Y: (n x 1) Y training data.
          train_Yvar: (n x 1) Noise variances of each training Y. If None,
              we use an inferred noise likelihood.
          decomposition: Keys are context names. Values are the indexes of
              parameters belong to the context. The parameter indexes are in
              the same order across contexts.
      """
      super().__init__(
          train_X=train_X, train_Y=train_Y, train_Yvar=train_Yvar
      )
      self.covar_module = SACKernel(
          decomposition=decomposition,
          batch_shape=self._aug_batch_shape,
          device=train_X.device,
      )
      self.decomposition = decomposition
      self.to(train_X)
  
file_path: botorch/botorch/models/contextual.py
imports: from typing import Any, Dict, List, Optional
  from botorch.models.gp_regression import SingleTaskGP
  from botorch.models.kernels.contextual_lcea import LCEAKernel
  from botorch.models.kernels.contextual_sac import SACKernel
  from botorch.utils.datasets import SupervisedDataset
  from torch import Tensor
label_desc: Use image node_id 1 to create a new SACGP object from inherited base classes: SingleTaskGP with example: obj = SACGP(train_X, train_Y, train_Yvar, decomposition)