class_docstr: Base class for datasets consisting of labelled pairs `(X, Y)`
  and an optional `Yvar` that stipulates observations variances so
  that `Y[i] ~ N(f(X[i]), Yvar[i])`.
  
  Example:
  
  .. code-block:: python
  
      X = torch.rand(16, 2)
      Y = torch.rand(16, 1)
      feature_names = ["learning_rate", "embedding_dim"]
      outcome_names = ["neg training loss"]
      A = SupervisedDataset(
          X=X,
          Y=Y,
          feature_names=feature_names,
          outcome_names=outcome_names,
      )
      B = SupervisedDataset(
          X=DenseContainer(X, event_shape=X.shape[-1:]),
          Y=DenseContainer(Y, event_shape=Y.shape[-1:]),
          feature_names=feature_names,
          outcome_names=outcome_names,
      )
      assert A == B
docstr: Constructs a `SupervisedDataset`.
  
  Args:
      X: A `Tensor` or `BotorchContainer` representing the input features.
      Y: A `Tensor` or `BotorchContainer` representing the outcomes.
      feature_names: A list of names of the features in `X`.
      outcome_names: A list of names of the outcomes in `Y`.
      Yvar: An optional `Tensor` or `BotorchContainer` representing
          the observation noise.
      validate_init: If `True`, validates the input shapes.
code: def __init__(
      self,
      X: Union[BotorchContainer, Tensor],
      Y: Union[BotorchContainer, Tensor],
      *,
      feature_names: List[str],
      outcome_names: List[str],
      Yvar: Union[BotorchContainer, Tensor, None] = None,
      validate_init: bool = True,
  ) -> None:
      r"""Constructs a `SupervisedDataset`.
  
      Args:
          X: A `Tensor` or `BotorchContainer` representing the input features.
          Y: A `Tensor` or `BotorchContainer` representing the outcomes.
          feature_names: A list of names of the features in `X`.
          outcome_names: A list of names of the outcomes in `Y`.
          Yvar: An optional `Tensor` or `BotorchContainer` representing
              the observation noise.
          validate_init: If `True`, validates the input shapes.
      """
      self._X = X
      self._Y = Y
      self._Yvar = Yvar
      self.feature_names = feature_names
      self.outcome_names = outcome_names
      if validate_init:
          self._validate()
  
imports: from __future__ import annotations
  import collections
  import warnings
  from typing import Any, Dict, List, Optional, Union
  import torch
  from botorch.exceptions.errors import InputDataError, UnsupportedError
  from botorch.utils.containers import BotorchContainer, SliceContainer
  from torch import long, ones, Tensor
label_desc: Use image node_id 1 to create a new SupervisedDataset object  with example: obj = SupervisedDataset(X, Y)