Datasets

The datasets submodule provides pytorch datasets for fast integration in model pipeline for eyetracking data.

class eyefeatures.deep.datasets.Dataset2D(X, Y, x, y, pk, shape, representations, upload_to_cuda=False, transforms=None)[source]

Bases: Dataset

Custom dataset for 2D image-based representations derived from gaze data.

Parameters:
  • X (DataFrame) – Input data.

  • Y (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) – Labels for the data.

  • pk (list[str]) – List of primary keys for grouping.

  • shape (tuple[int] | int) – Shape of the images.

  • representations (list[str]) – List of representation types.

  • upload_to_cuda (bool) – If True, upload the data to the GPU. Default: False.

  • transforms – Transformations to apply to the data.

  • x (str)

  • y (str)

class eyefeatures.deep.datasets.DatasetTimeSeries(X, Y, x, y, pk, features=None, transforms=None, max_length=10)[source]

Bases: Dataset

Custom dataset for time-series data.

Parameters:
  • X (DataFrame) – Input time-series data.

  • Y (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) – Labels for the data.

  • pk (list[str]) – Primary keys for grouping.

  • features (list[str] | None) – List of features to extract. If None, only x and y coordinates are used.

  • transforms (Callable) – Transformations to apply to the data.

  • max_length (int) – maximum length of scanpath.

  • x (str)

  • y (str)

class eyefeatures.deep.datasets.TimeSeries_2D_Dataset(image_dataset, sequence_dataset)[source]

Bases: Dataset

Composite dataset that combines image and time-series data.

Parameters:
  • image_dataset (Dataset) – Dataset containing image data.

  • sequence_dataset (Dataset) – Dataset containing sequence data.

class eyefeatures.deep.datasets.GridGraphDataset(X, Y, x, y, add_duration, pk, xlim=(0, 1), ylim=(0, 1), shape=(10, 10), directed=True, transforms=None)[source]

Bases: Dataset

Custom dataset for generating grid-based graph representations from spatial coordinates.

Parameters:
  • X (DataFrame) – Input dataframe.

  • Y (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) – Labels for the data.

  • x (str) – X coordinate column name.

  • y (str) – Y coordinate column name.

  • pk (list[str]) – Primary keys for grouping.

  • x_col – Column names for x and y coordinates.

  • y_col – Column names for x and y coordinates.

  • add_duration (str) – Column name for time durations.

  • xlim (tuple[float, float]) – Limits of the x-axis.

  • ylim (tuple[float, float]) – Limits of the y-axis.

  • shape (tuple[int, int]) – Shape of the grid.

  • directed (bool) – Whether the graph is directed.

  • transforms (Callable) – Transformations to apply to the data.