GraphTUDataset(root, name, transform=None, pre_transform=None, pre_filter=None)

Bases: InMemoryDataset

TUGraph Dataset loader for graph-based analysis.

Parameters:
  • root (str) –

    Root directory where the dataset should be saved

  • name (str) –

    Name of the TU dataset

  • transform (callable, default: None ) –

    Function/transform that takes in a Data object and returns a transformed version. Default: None

  • pre_transform (callable, default: None ) –

    Function/transform to be applied to the data object before saving. Default: None

  • pre_filter (callable, default: None ) –

    Function that takes in a Data object and returns a boolean value, indicating whether the data object should be included. Default: None

Notes

Dataset Structure:

  • Collection of graphs
  • Each graph has its own structure and features
  • Supports various graph classification tasks
  • Random shuffling for better training
processed_file_names property

Names of processed data files.

Returns:
  • list[str]

    List of processed file names

Notes

Processed files:

  • data.pt: Contains processed PyTorch Geometric data objects
raw_file_names property

Names of required raw files.

Returns:
  • list[str]

    List of required raw file names

Notes

Required files:

  • .pkl: Pickle file containing list of graph data objects
download()

Download raw data files.

Notes

Empty implementation - data should be manually placed in raw directory

process()

Process raw data into PyTorch Geometric Data format.

Notes

Processing Steps:

  • Load pickle data:

    • List of graph data objects
  • Random shuffling:

    • Shuffle graphs for better training
  • Apply pre-transform:

    • Transform each graph if specified
  • Collate graphs:

    • Combine into single data object
  • Save processed data

Features:

  • Multiple graph handling
  • Random shuffling
  • Optional pre-transform support
  • Batch processing support