class_docstr: Samples random dimensions from the target at training time.
class_docstr_tok: ["Samples","random","dimensions","from","the","target","at","training","time","."]
code: def __init__(
      self,
      field_name: str,
      target_field: str,
      observed_values_field: str,
      num_samples: int,
      shuffle: bool = True,
  ) -> None:
      super().__init__()
  
      self.field_name = field_name
      self.target_field = target_field
      self.observed_values_field = observed_values_field
      self.num_samples = num_samples
      self.shuffle = shuffle
  
imports: from typing import Callable, Iterator, List, Optional, Tuple, Type
  import numpy
  from toolz import valmap
  from gluonts.core.component import validated, tensor_to_numpy
  from gluonts.dataset.common import DataEntry
  from gluonts.exceptions import assert_data_error
  from ._base import FlatMapTransformation, MapTransformation, SimpleTransformation
label_desc: Use image node_id 1 to create a new SampleTargetDim object from inherited base classes: FlatMapTransformation with example: obj = SampleTargetDim(field_name, target_field, observed_values_field, num_samples, shuffle)