easygraph.datasets.hypergraph.cooking_200 module#

class easygraph.datasets.hypergraph.cooking_200.Cooking200(data_root: str | None = None)[source]#

Bases: BaseData

The Cooking 200 dataset is collected from Yummly.com for vertex classification task. It is a hypergraph dataset, in which vertex denotes the dish and hyperedge denotes the ingredient. Each dish is also associated with category information, which indicates the dish’s cuisine like Chinese, Japanese, French, and Russian.

The content of the Cooking200 dataset includes the following:

  • num_classes: The number of classes: \(20\).

  • num_vertices: The number of vertices: \(7,403\).

  • num_edges: The number of edges: \(2,755\).

  • edge_list: The edge list. List with length \((2,755)\).

  • labels: The label list. torch.LongTensor with size \((7,403)\).

  • train_mask: The train mask. torch.BoolTensor with size \((7,403)\).

  • val_mask: The validation mask. torch.BoolTensor with size \((7,403)\).

  • test_mask: The test mask. torch.BoolTensor with size \((7,403)\).

Parameters:

data_root (str, optional) – The data_root has stored the data. If set to None, this function will auto-download from server and save into the default direction ~/.dhg/datasets/. Defaults to None.

Attributes:
content

Return the content of the dataset.

Methods

fetch_files(files)

Download and check the files if they are not exist.

needs_to_load(item_name)

Return whether the item_name of the dataset needs to be loaded.

raw(key)

Return the key of the dataset with un-preprocessed format.