easygraph.datasets.flickr module#

class easygraph.datasets.flickr.FlickrDataset(raw_dir=None, force_reload=False, verbose=False, transform=None, reorder=False)[source]#

Bases: EasyGraphBuiltinDataset

Flickr dataset for node classification.

Nodes are images and edges represent social tags co-occurrence. Node features are precomputed image embeddings. Labels indicate image categories.

Statistics: - Nodes: 89,250 - Edges: 899,756 - Classes: 7 - Feature dim: 500

Source: GraphSAINT (https://arxiv.org/abs/1907.04931)

Parameters:
  • raw_dir (str, optional) – Custom directory to download the dataset. Default: None (uses standard cache dir).

  • force_reload (bool, optional) – Whether to re-download and reprocess. Default: False.

  • verbose (bool, optional) – Whether to print loading progress. Default: False.

  • transform (callable, optional) – A transform applied to the graph on access.

  • reorder (bool, optional) – Whether to apply graph reordering for locality (requires torch). Default: False.

Examples

>>> from easygraph.datasets import FlickrDataset
>>> ds = FlickrDataset(verbose=True)
>>> g = ds[0]
>>> print(g.number_of_nodes(), g.number_of_edges(), ds.num_classes)
>>> print(g.nodes[0]['feat'].shape, g.nodes[0]['label'])
property num_classes#
process()[source]#

Overwrite to realize your own logic of processing the input data.