Registry / ai-ml / ogb
library1.3.6pypypiunverified

A library for downloading, preprocessing, and evaluating on the Open Graph Benchmark (OGB) datasets. Version 1.3.6 fixes Pandas 2.0 compatibility. Releases are periodic, with occasional major dataset updates.

pip install ogb
INSTALL
IMPORT
SIG · OGB
O
ogb
ai-mlpythonv1.3.6
Install
78.8s avg
Import
Disk
5094MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 87.3s
py 3.11
✕ build_error
✓ 84.4s
py 3.12
✕ build_error
✓ 72.9s
py 3.13
✕ build_error
✓ 70.8s
py 3.9
✕ build_error
✕ timeout
5094MB installed
● package 5094MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dataset classes
from ogb.nodeproppred import PygNodePropPredDataset
from ogb.nodeproppred import NodePropertyPrediction
OGB provides PyG/DGL wrapper datasets; raw import is rarely used.
Evaluator
from ogb.nodeproppred import Evaluator
from ogb.utils import Evaluator
Evaluator is dataset-specific, import from the correct submodule.

Load the ogbn-arxiv dataset using PyG wrapper and run a dummy evaluation.

from ogb.nodeproppred import PygNodePropPredDataset from ogb.nodeproppred import Evaluator dataset = PygNodePropPredDataset(name='ogbn-arxiv') split_idx = dataset.get_idx_split() train_idx, valid_idx, test_idx = split_idx['train'], split_idx['valid'], split_idx['test'] graph = dataset[0] # For evaluation, use the evaluator evaluator = Evaluator(name='ogbn-arxiv') # Example: dummy predictions and labels (for illustration only) import torch y_pred = torch.randn(len(graph.y)) y_true = graph.y result = evaluator.eval({'y_pred': y_pred, 'y_true': y_true}) print(result)
Debug
Known issues
deprecatedDatasets ogbl-wikikg and ogbl-citation are deprecated; use ogbl-wikikg2 and ogbl-citation2 instead.
fix
Use ogbl-wikikg2 and ogbl-citation2; old names will raise a deprecation warning.
affects: <1.2.4
deprecatedogbg-code dataset is deprecated due to target leakage; use ogbg-code2.
fix
Replace ogbg-code with ogbg-code2 in dataset name.
affects: >=1.2.5
breakingImport stuck bug in version 1.3.4: downloading may hang.
fix
Upgrade to ogb==1.3.5 or later (pip install --upgrade ogb).
affects: 1.3.4
gotchaOGB datasets download from external URLs. Offline or restricted networks may fail.
fix
Pre-download manually or set OGB_CACHE_DIR environment variable to a cached location.
affects: all
gotchaPandas 2.0 breaks compatibility with older ogb versions (<1.3.6).
fix
Use pandas<2.0 or upgrade ogb to 1.3.6+.
affects: <1.3.6
Upgrade
Version history
1.3.6latest on PyPI · released Apr 7, 2023
Audit
Dependencies
numpyrequiredCore dependency for graph data structures
pandasrequiredUsed for tabular data loading
tqdmrequiredProgress bars for downloads
scikit-learnoptionalFor evaluation metrics (e.g., ROC-AUC)
torchoptionalFor PyTorch tensor conversion and dataloaders
Agent activity
4 hits · last 30 days
node
4
Resources