WikiMathDataLoader

class stgraph.dataset.WikiMathDataLoader(verbose: bool = False, lags: int = 8, cutoff_time: int | None = None, redownload: bool = False)[source]

Bases: STGraphTemporalDataset

Vital mathematical articles sourced from Wikipedia.

The graph dataset is static, with vertices representing Wikipedia pages and edges representing links. The graph is both directed and weighted, where the weights indicate the number of links originating from the source page connecting to the target page. The target is the daily user visits to the Wikipedia pages between March 16th 2019 and March 15th 2021 which results in 731 periods.

This class provides functionality for loading, processing, and accessing the Hungary Chickenpox dataset for use in deep learning tasks such as County level case count prediction.

gdata

num_nodes

num_edges

total_timestamps

1068

27079

731

Example

from stgraph.dataset import WikiMathDataLoader

wiki = WikiMathDataLoader(verbose=True)
num_nodes = wiki.gdata["num_nodes"]
num_edges = wiki.gdata["num_edges"]
total_timestamps = wiki.gdata["total_timestamps"]

edge_list = wiki.get_edges()
edge_weights = wiki.get_edge_weights()
targets = wiki.get_all_targets()
Parameters:
  • verbose (bool, optional) – Flag to control whether to display verbose info (default is False)

  • lags (int, optional) – The number of time lags (default is 8)

  • cutoff_time (int, optional) – The cutoff timestamp for the temporal dataset (default is None)

  • redownload (bool, optional (default is False)) – Redownload the dataset online and save to cache

name

The name of the dataset.

Type:

str

gdata

Graph meta data.

Type:

dict

get_all_targets() ndarray[source]

Return the targets for each timestamp.

get_edge_weights() ndarray[source]

Return the edge weights.

get_edges() list[source]

Return the edge list.