nip.scenario_base.data.Dataset

nip.scenario_base.data.Dataset#

class nip.scenario_base.data.Dataset(hyper_params: HyperParameters, settings: ExperimentSettings, protocol_handler: ProtocolHandler, train: bool = True)[source]#

Base class for all datasets.

All datasets should have the following keys:

  • “y”: The true label (0 or 1).

  • “id”: The index of the data point.

Dataset will have additional keys specifying the input instance.

Parameters:
  • hyper_params (HyperParameters) – The parameters for the experiment.

  • settings (ExperimentSettings) – The settings for the experiment.

  • protocol_handler (ProtocolHandler) – The protocol handler for the experiment.

  • train (bool) – Whether to load the training or test set.

Methods Summary

__getitem__(index)

__init__(hyper_params, settings, ...[, train])

__len__()

Attributes

instance_keys

The keys specifying the input instance.

keys

The keys (field names) in the dataset.

Methods

abstract __getitem__(index: None | int | slice | str | Tensor | List[Any] | Tuple[Any, ...]) Any[source]#
__init__(hyper_params: HyperParameters, settings: ExperimentSettings, protocol_handler: ProtocolHandler, train: bool = True)[source]#
abstract __len__() int[source]#