easygraph.datasets.karate module#

class easygraph.datasets.karate.KarateClubDataset(transform=None)[source]#

Bases: EasyGraphDataset

Karate Club dataset for Node Classification

Zachary’s karate club is a social network of a university karate club, described in the paper “An Information Flow Model for Conflict and Fission in Small Groups” by Wayne W. Zachary. The network became a popular example of community structure in networks after its use by Michelle Girvan and Mark Newman in 2002. Official website: http://konect.cc/networks/ucidata-zachary/

Karate Club dataset statistics:

  • Nodes: 34

  • Edges: 156

  • Number of Classes: 2

Parameters:

transform (callable, optional) – A transform that takes in a Graph object and returns a transformed version. The Graph object will be transformed before every access.

num_classes#

Number of node classes

Type:

int

Examples

>>> dataset = KarateClubDataset()
>>> num_classes = dataset.num_classes
>>> g = dataset[0]
>>> labels = g.ndata['label']
Attributes:
hash

Hash value for the dataset and the setting.

name

Name of the dataset.

num_classes

Number of classes.

raw_dir

Raw file directory contains the input data folder.

raw_path

Directory contains the input data files.

save_dir

Directory to save the processed dataset.

save_path

Path to save the processed dataset.

url

Get url to download the raw dataset.

verbose

Whether to print information.

Methods

download()

Overwrite to realize your own logic of downloading data.

has_cache()

Overwrite to realize your own logic of deciding whether there exists a cached dataset.

load()

Overwrite to realize your own logic of loading the saved dataset from files.

process()

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

save()

Overwrite to realize your own logic of saving the processed dataset into files.

property num_classes#

Number of classes.

process()[source]#

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