gammagl.datasets.Amazon

class Amazon(root: str | None = None, name: str = 'computers', transform: Callable | None = None, pre_transform: Callable | None = None, force_reload: bool = False)[source]

The Amazon Computers and Amazon Photo networks from the “Pitfalls of Graph Neural Network Evaluation” paper. Nodes represent goods and edges represent that two goods are frequently bought together. Given product reviews as bag-of-words node features, the task is to map goods to their respective product category.

Parameters:
  • root (str, optional) – Root directory where the dataset should be saved.

  • name (str, optional) – The name of the dataset ("Computers", "Photo").

  • transform (callable, optional) – A function/transform that takes in an gammagl.data.Graph object and returns a transformed version. The data object will be transformed before every access. (default: None)

  • pre_transform (callable, optional) – A function/transform that takes in an gammagl.data.Graph object and returns a transformed version. The data object will be transformed before being saved to disk. (default: None)

  • (bool (force_reload) – (default: False)

  • optional) (Whether to re-process the dataset.) – (default: False)

  • Stats

    Name

    #nodes

    #edges

    #features

    #classes

    Computers

    13,752

    491,722

    767

    10

    Photo

    7,650

    238,162

    745

    8

url = 'https://github.com/shchur/gnn-benchmark/raw/master/data/npz/'
property raw_dir: str
property processed_dir: str
property raw_file_names: str

The name of the files in the self.raw_dir folder that must be present in order to skip downloading.

property processed_file_names: str

The name of the files in the self.processed_dir folder that must be present in order to skip processing.

download()[source]

Downloads the dataset to the self.raw_dir folder.

process()[source]

Processes the dataset to the self.processed_dir folder.