class_docstr: A dataset split provides all the representations for a particular split (train/val/test) of a
  dataset.
class_docstr_tok: ["A","dataset","split","provides","all","the","representations","for","a","particular","split","(","train\/val\/test",")","of","a","dataset","."]
docstr: Returns a time series dataset for the dataset split. This loads the associated JSON file and
  is, thus, potentially slow.
docstr_tok: ["Returns","a","time","series","dataset","for","the","dataset","split",".","This","loads","the","associated","JSON","file","and","is",",","thus",",","potentially","slow","."]
code: def data(self, evaluation: bool = False) -> TimeSeriesDataset:
      """
      Returns a time series dataset for the dataset split. This loads the associated JSON file and
      is, thus, potentially slow.
      """
      gluonts = FileDataset(
          self._directory / self._split, freq=self._metadata.freq
      )
      series = [
          TimeSeries(
              dataset_name=self._dataset_name,
              values=torch.from_numpy(item[FieldName.TARGET]).unsqueeze(
                  -1
              ),
              item_id=item[FieldName.ITEM_ID],
              start_date=item[FieldName.START],
          )
          for item in gluonts
      ]
      dataset = TimeSeriesDataset(
          series=series,
          prediction_length=self._metadata.prediction_length,
          freq=self._metadata.freq,
          # do not standardize evaluation dataset
          standardize=self._standardize and not evaluation,
      )
      return dataset
  
imports: from __future__ import annotations
  import json
  from dataclasses import dataclass
  from typing import Tuple, Optional, List
  from pathlib import Path
  from gluonts.dataset.common import FileDataset, MetaData
  from gluonts.dataset.field_names import FieldName
  import torch
  import numpy
  import numpy.ma
  import shutil
  from meta.data.dataset import TimeSeries, TimeSeriesDataset
  from meta.common import tensor_to_np
label_desc: Use image node_id 1 for calling the DatasetSplit obj's underlying member method code with example usage: obj.data(evaluation) and returns: dataset