class_docstr: A SupervisedDataset whose labelled pairs `(x, y)` consist of m-ary combinations
  `x ∈ Z^{m}` of elements from a ground set `Z = (z_1, ...)` and ranking vectors
  `y {0, ..., m - 1}^{m}` with properties:
  
      a) Ranks start at zero, i.e. min(y) = 0.
      b) Sorted ranks are contiguous unless one or more ties are present.
      c) `k` ranks are skipped after a `k`-way tie.
  
  Example:
  
  .. code-block:: python
  
      X = SliceContainer(
          values=torch.rand(16, 2),
          indices=torch.stack([torch.randperm(16)[:3] for _ in range(8)]),
          event_shape=torch.Size([3 * 2]),
      )
      Y = DenseContainer(
          torch.stack([torch.randperm(3) for _ in range(8)]),
          event_shape=torch.Size([3])
      )
      feature_names = ["item_0", "item_1"]
      outcome_names = ["ranking outcome"]
      dataset = RankingDataset(
          X=X,
          Y=Y,
          feature_names=feature_names,
          outcome_names=outcome_names,
      )
docstr: Construct a `RankingDataset`.
  
  Args:
      X: A `SliceContainer` representing the input features being ranked.
      Y: A `Tensor` or `BotorchContainer` representing the rankings.
      feature_names: A list of names of the features in X.
      outcome_names: A list of names of the outcomes in Y.
      validate_init: If `True`, validates the input shapes.
code: def __init__(
      self,
      X: SliceContainer,
      Y: Union[BotorchContainer, Tensor],
      feature_names: List[str],
      outcome_names: List[str],
      validate_init: bool = True,
  ) -> None:
      r"""Construct a `RankingDataset`.
  
      Args:
          X: A `SliceContainer` representing the input features being ranked.
          Y: A `Tensor` or `BotorchContainer` representing the rankings.
          feature_names: A list of names of the features in X.
          outcome_names: A list of names of the outcomes in Y.
          validate_init: If `True`, validates the input shapes.
      """
      super().__init__(
          X=X,
          Y=Y,
          feature_names=feature_names,
          outcome_names=outcome_names,
          Yvar=None,
          validate_init=validate_init,
      )
  
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 RankingDataset object from inherited base classes: SupervisedDataset with example: obj = RankingDataset(X, Y, feature_names, outcome_names, validate_init)