easygraph.datasets.facebook_ego module#

Facebook Ego-Net Dataset

This dataset contains a subset of Facebook’s social network collected from survey participants in the SNAP EgoNet project. Nodes represent users, and edges indicate friendship links between them.

Each ego network is centered on a user and includes their friend connections and friend-to-friend connections. The .circles files contain labeled groups (i.e., communities) of friends identified by the ego user.

This version processes all ego-nets as a single undirected graph. Node features are not provided. Labels (circles) are optional and not included by default.

Statistics (based on merged graph): - Nodes: ~4,000+ - Edges: ~88,000+ - Features: None - Classes: None

Reference: J. McAuley and J. Leskovec, “Learning to Discover Social Circles in Ego Networks,” in NIPS, 2012. [https://snap.stanford.edu/data/egonets-Facebook.html]

class easygraph.datasets.facebook_ego.FacebookEgoNetDataset(raw_dir=None, force_reload=False, verbose=True, transform=None)[source]#

Bases: EasyGraphBuiltinDataset

Facebook Ego-Net social network dataset.

Each node is a user, and edges represent friendship. The dataset includes 10 ego networks centered on different users.

Parameters:
  • raw_dir (str, optional) – Directory to store the raw downloaded files. Default: None

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

  • verbose (bool, optional) – Whether to print detailed processing logs. Default: True

  • transform (callable, optional) – Optional transform to apply on the graph.

Examples

>>> from easygraph.datasets import FacebookEgoNetDataset
>>> dataset = FacebookEgoNetDataset()
>>> g = dataset[0]
>>> print("Nodes:", g.number_of_nodes())
>>> print("Edges:", g.number_of_edges())
download()[source]#

Automatically download data and extract it.

process()[source]#

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