ogb


Nameogb JSON
Version 1.3.6 PyPI version JSON
download
home_pagehttps://github.com/snap-stanford/ogb
SummaryOpen Graph Benchmark
upload_time2023-04-07 05:59:02
maintainer
docs_urlNone
authorOGB Team
requires_python
licenseMIT
keywords pytorch graph machine learning graph representation learning graph neural networks
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align='center'>
  <img width='40%' src='https://snap-stanford.github.io/ogb-web/assets/img/OGB_rectangle.png' />
</p>

--------------------------------------------------------------------------------

[![PyPI](https://img.shields.io/pypi/v/ogb)](https://pypi.org/project/ogb/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/snap-stanford/ogb/blob/master/LICENSE)

## Overview

The Open Graph Benchmark (OGB) is a collection of benchmark datasets, data loaders, and evaluators for graph machine learning. Datasets cover a variety of graph machine learning tasks and real-world applications.
The OGB data loaders are fully compatible with popular graph deep learning frameworks, including [PyTorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/) and [Deep Graph Library (DGL)](https://www.dgl.ai/). They provide automatic dataset downloading, standardized dataset splits, and unified performance evaluation.

<p align='center'>
  <img width='80%' src='https://snap-stanford.github.io/ogb-web/assets/img/ogb_overview.png' />
</p>

OGB aims to provide graph datasets that cover important graph machine learning tasks, diverse dataset scale, and rich domains.

**Graph ML Tasks:** We cover three fundamental graph machine learning tasks: prediction at the level of nodes, links, and graphs.

**Diverse scale:** Small-scale graph datasets can be processed within a single GPU, while medium- and large-scale graphs might require multiple GPUs or clever sampling/partition techniques.

**Rich domains:** Graph datasets come from diverse domains ranging from scientific ones to social/information networks, and also include heterogeneous knowledge graphs. 

<p align='center'>
  <img width='70%' src='https://snap-stanford.github.io/ogb-web/assets/img/dataset_overview.png' />
</p>

OGB is an on-going effort, and we are planning to increase our coverage in the future.

## Installation
You can install OGB using Python's package manager `pip`.
**If you have previously installed ogb, please make sure you update the version to 1.3.6.**
The release note is available [here](https://github.com/snap-stanford/ogb/releases/tag/1.3.6).

#### Requirements
 - Python>=3.6
 - PyTorch>=1.6
 - DGL>=0.5.0 or torch-geometric>=2.0.2
 - Numpy>=1.16.0
 - pandas>=0.24.0
 - urllib3>=1.24.0
 - scikit-learn>=0.20.0
 - outdated>=0.2.0

#### Pip install
The recommended way to install OGB is using Python's package manager pip:
```bash
pip install ogb
```

```bash
python -c "import ogb; print(ogb.__version__)"
# This should print "1.3.6". Otherwise, please update the version by
pip install -U ogb
```


#### From source
You can also install OGB from source. This is recommended if you want to contribute to OGB.
```bash
git clone https://github.com/snap-stanford/ogb
cd ogb
pip install -e .
```

## Package Usage
We highlight two key features of OGB, namely, (1) easy-to-use data loaders, and (2) standardized evaluators.
#### (1) Data loaders
We prepare easy-to-use PyTorch Geometric and DGL data loaders. We handle dataset downloading as well as standardized dataset splitting.
Below, on PyTorch Geometric, we see that a few lines of code is sufficient to prepare and split the dataset! Needless to say, you can enjoy the same convenience for DGL!
```python
from ogb.graphproppred import PygGraphPropPredDataset
from torch_geometric.loader import DataLoader

# Download and process data at './dataset/ogbg_molhiv/'
dataset = PygGraphPropPredDataset(name = 'ogbg-molhiv')

split_idx = dataset.get_idx_split() 
train_loader = DataLoader(dataset[split_idx['train']], batch_size=32, shuffle=True)
valid_loader = DataLoader(dataset[split_idx['valid']], batch_size=32, shuffle=False)
test_loader = DataLoader(dataset[split_idx['test']], batch_size=32, shuffle=False)
```

#### (2) Evaluators
We also prepare standardized evaluators for easy evaluation and comparison of different methods. The evaluator takes `input_dict` (a dictionary whose format is specified in `evaluator.expected_input_format`) as input, and returns a dictionary storing the performance metric appropriate for the given dataset.
The standardized evaluation protocol allows researchers to reliably compare their methods.
```python
from ogb.graphproppred import Evaluator

evaluator = Evaluator(name = 'ogbg-molhiv')
# You can learn the input and output format specification of the evaluator as follows.
# print(evaluator.expected_input_format) 
# print(evaluator.expected_output_format) 
input_dict = {'y_true': y_true, 'y_pred': y_pred}
result_dict = evaluator.eval(input_dict) # E.g., {'rocauc': 0.7321}
```

## Citing OGB / OGB-LSC
If you use OGB or [OGB-LSC](https://ogb.stanford.edu/docs/lsc/) datasets in your work, please cite our papers (Bibtex below).
```
@article{hu2020ogb,
  title={Open Graph Benchmark: Datasets for Machine Learning on Graphs},
  author={Hu, Weihua and Fey, Matthias and Zitnik, Marinka and Dong, Yuxiao and Ren, Hongyu and Liu, Bowen and Catasta, Michele and Leskovec, Jure},
  journal={arXiv preprint arXiv:2005.00687},
  year={2020}
}
```
```
@article{hu2021ogblsc,
  title={OGB-LSC: A Large-Scale Challenge for Machine Learning on Graphs},
  author={Hu, Weihua and Fey, Matthias and Ren, Hongyu and Nakata, Maho and Dong, Yuxiao and Leskovec, Jure},
  journal={arXiv preprint arXiv:2103.09430},
  year={2021}
}
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/snap-stanford/ogb",
    "name": "ogb",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "pytorch,graph machine learning,graph representation learning,graph neural networks",
    "author": "OGB Team",
    "author_email": "ogb@cs.stanford.edu",
    "download_url": "https://files.pythonhosted.org/packages/3f/0a/70cc51c00254be784b2b05ee50ec03ca3cf20f130c97cb3d29dd4e9dffce/ogb-1.3.6.tar.gz",
    "platform": null,
    "description": "<p align='center'>\n  <img width='40%' src='https://snap-stanford.github.io/ogb-web/assets/img/OGB_rectangle.png' />\n</p>\n\n--------------------------------------------------------------------------------\n\n[![PyPI](https://img.shields.io/pypi/v/ogb)](https://pypi.org/project/ogb/)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/snap-stanford/ogb/blob/master/LICENSE)\n\n## Overview\n\nThe Open Graph Benchmark (OGB) is a collection of benchmark datasets, data loaders, and evaluators for graph machine learning. Datasets cover a variety of graph machine learning tasks and real-world applications.\nThe OGB data loaders are fully compatible with popular graph deep learning frameworks, including [PyTorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/) and [Deep Graph Library (DGL)](https://www.dgl.ai/). They provide automatic dataset downloading, standardized dataset splits, and unified performance evaluation.\n\n<p align='center'>\n  <img width='80%' src='https://snap-stanford.github.io/ogb-web/assets/img/ogb_overview.png' />\n</p>\n\nOGB aims to provide graph datasets that cover important graph machine learning tasks, diverse dataset scale, and rich domains.\n\n**Graph ML Tasks:** We cover three fundamental graph machine learning tasks: prediction at the level of nodes, links, and graphs.\n\n**Diverse scale:** Small-scale graph datasets can be processed within a single GPU, while medium- and large-scale graphs might require multiple GPUs or clever sampling/partition techniques.\n\n**Rich domains:** Graph datasets come from diverse domains ranging from scientific ones to social/information networks, and also include heterogeneous knowledge graphs. \n\n<p align='center'>\n  <img width='70%' src='https://snap-stanford.github.io/ogb-web/assets/img/dataset_overview.png' />\n</p>\n\nOGB is an on-going effort, and we are planning to increase our coverage in the future.\n\n## Installation\nYou can install OGB using Python's package manager `pip`.\n**If you have previously installed ogb, please make sure you update the version to 1.3.6.**\nThe release note is available [here](https://github.com/snap-stanford/ogb/releases/tag/1.3.6).\n\n#### Requirements\n - Python>=3.6\n - PyTorch>=1.6\n - DGL>=0.5.0 or torch-geometric>=2.0.2\n - Numpy>=1.16.0\n - pandas>=0.24.0\n - urllib3>=1.24.0\n - scikit-learn>=0.20.0\n - outdated>=0.2.0\n\n#### Pip install\nThe recommended way to install OGB is using Python's package manager pip:\n```bash\npip install ogb\n```\n\n```bash\npython -c \"import ogb; print(ogb.__version__)\"\n# This should print \"1.3.6\". Otherwise, please update the version by\npip install -U ogb\n```\n\n\n#### From source\nYou can also install OGB from source. This is recommended if you want to contribute to OGB.\n```bash\ngit clone https://github.com/snap-stanford/ogb\ncd ogb\npip install -e .\n```\n\n## Package Usage\nWe highlight two key features of OGB, namely, (1) easy-to-use data loaders, and (2) standardized evaluators.\n#### (1) Data loaders\nWe prepare easy-to-use PyTorch Geometric and DGL data loaders. We handle dataset downloading as well as standardized dataset splitting.\nBelow, on PyTorch Geometric, we see that a few lines of code is sufficient to prepare and split the dataset! Needless to say, you can enjoy the same convenience for DGL!\n```python\nfrom ogb.graphproppred import PygGraphPropPredDataset\nfrom torch_geometric.loader import DataLoader\n\n# Download and process data at './dataset/ogbg_molhiv/'\ndataset = PygGraphPropPredDataset(name = 'ogbg-molhiv')\n\nsplit_idx = dataset.get_idx_split() \ntrain_loader = DataLoader(dataset[split_idx['train']], batch_size=32, shuffle=True)\nvalid_loader = DataLoader(dataset[split_idx['valid']], batch_size=32, shuffle=False)\ntest_loader = DataLoader(dataset[split_idx['test']], batch_size=32, shuffle=False)\n```\n\n#### (2) Evaluators\nWe also prepare standardized evaluators for easy evaluation and comparison of different methods. The evaluator takes `input_dict` (a dictionary whose format is specified in `evaluator.expected_input_format`) as input, and returns a dictionary storing the performance metric appropriate for the given dataset.\nThe standardized evaluation protocol allows researchers to reliably compare their methods.\n```python\nfrom ogb.graphproppred import Evaluator\n\nevaluator = Evaluator(name = 'ogbg-molhiv')\n# You can learn the input and output format specification of the evaluator as follows.\n# print(evaluator.expected_input_format) \n# print(evaluator.expected_output_format) \ninput_dict = {'y_true': y_true, 'y_pred': y_pred}\nresult_dict = evaluator.eval(input_dict) # E.g., {'rocauc': 0.7321}\n```\n\n## Citing OGB / OGB-LSC\nIf you use OGB or [OGB-LSC](https://ogb.stanford.edu/docs/lsc/) datasets in your work, please cite our papers (Bibtex below).\n```\n@article{hu2020ogb,\n  title={Open Graph Benchmark: Datasets for Machine Learning on Graphs},\n  author={Hu, Weihua and Fey, Matthias and Zitnik, Marinka and Dong, Yuxiao and Ren, Hongyu and Liu, Bowen and Catasta, Michele and Leskovec, Jure},\n  journal={arXiv preprint arXiv:2005.00687},\n  year={2020}\n}\n```\n```\n@article{hu2021ogblsc,\n  title={OGB-LSC: A Large-Scale Challenge for Machine Learning on Graphs},\n  author={Hu, Weihua and Fey, Matthias and Ren, Hongyu and Nakata, Maho and Dong, Yuxiao and Leskovec, Jure},\n  journal={arXiv preprint arXiv:2103.09430},\n  year={2021}\n}\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Open Graph Benchmark",
    "version": "1.3.6",
    "split_keywords": [
        "pytorch",
        "graph machine learning",
        "graph representation learning",
        "graph neural networks"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7e95e0770cf1ad9667492f56b732f44398ef2756d61df914e10d121a3cad013a",
                "md5": "109fa104eae0eb040a7c55baf4ad0680",
                "sha256": "29ab84078c66a7846bf137c9be9545978616a053e734c032a2ff731d026bb5e9"
            },
            "downloads": -1,
            "filename": "ogb-1.3.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "109fa104eae0eb040a7c55baf4ad0680",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 78750,
            "upload_time": "2023-04-07T05:59:00",
            "upload_time_iso_8601": "2023-04-07T05:59:00.053756Z",
            "url": "https://files.pythonhosted.org/packages/7e/95/e0770cf1ad9667492f56b732f44398ef2756d61df914e10d121a3cad013a/ogb-1.3.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f0a70cc51c00254be784b2b05ee50ec03ca3cf20f130c97cb3d29dd4e9dffce",
                "md5": "b7ad1a8d865f82128514e9f30b204bcf",
                "sha256": "ce90418a0e3206483187aa7b7ecac1a2c5d85b3b99aceedb807138ee43115914"
            },
            "downloads": -1,
            "filename": "ogb-1.3.6.tar.gz",
            "has_sig": false,
            "md5_digest": "b7ad1a8d865f82128514e9f30b204bcf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 48908,
            "upload_time": "2023-04-07T05:59:02",
            "upload_time_iso_8601": "2023-04-07T05:59:02.964439Z",
            "url": "https://files.pythonhosted.org/packages/3f/0a/70cc51c00254be784b2b05ee50ec03ca3cf20f130c97cb3d29dd4e9dffce/ogb-1.3.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-07 05:59:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "snap-stanford",
    "github_project": "ogb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ogb"
}
        
Elapsed time: 0.06661s