Datasets:
The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.
FORESEE
Processed traffic-demand datasets, pretrained checkpoints, and replication code for:
Learning from Yesterday's Error: An Efficient Online Learning Method for Traffic Demand Prediction
submitted to Communications in Transportation Research (COMMTR).
- Hub: https://huggingface.co/datasets/tjtrans/FORESEE
- Code mirror: https://github.com/xiannanhuang/FORESEE
Processed demand tensors in dataset/ are dedicated to the public domain under CC0 1.0. Source code is released under MIT.
Contents
dataset/<name>/{train,val,test,adj_mx}.npy
saved_models/{STGCN|GWNET}_<name>_final_model.pth
models/ # STGCN, Graph WaveNet, configs
tools/
train.py
foresee.py
eval_reproduce.py
expected_results/paper_metrics.csv
requirements.txt
Seven city/mode datasets: nycbike, nyctaxi, chibike, chitaxi, bosbike, baybike, torbike.
Dataset description
We provide processed hourly inflow/outflow demand tensors, not raw trip records. They are aggregated from publicly released bike-sharing and taxi trips in New York City, Chicago, Boston, the San Francisco Bay Area, and Toronto, then split chronologically into train / validation / test.
Each folder contains:
| File | Description |
|---|---|
train.npy / val.npy / test.npy |
Hourly inflow/outflow. Last dimension is 2. Accepted shapes: (nodes, days, 24, 2) or hour-first (hours, nodes, 2). |
adj_mx.npy |
Spatial adjacency among zones, shape (N, N). |
Zones whose training-period mean demand is <= 2 are dropped at load time (tools/data_tools.py, paper_valid_grid). After this filter, valid zone counts are: nycbike 74, nyctaxi 125, chibike 48, chitaxi 28, bosbike 43, baybike 36, torbike 36.
Raw shapes before that filter:
| Dataset | train | val | test | adj |
|---|---|---|---|---|
| nycbike | (200, 334, 24, 2) |
(200, 31, 24, 2) |
(200, 182, 24, 2) |
(200, 200) |
| nyctaxi | (263, 334, 24, 2) |
(263, 31, 24, 2) |
(263, 182, 24, 2) |
(265, 265) |
| chibike | (8016, 200, 2) |
(744, 200, 2) |
(4347, 200, 2) |
(200, 200) |
| chitaxi | (8016, 171, 2) |
(744, 171, 2) |
(4368, 171, 2) |
(200, 200) |
| bosbike | (8016, 300, 2) |
(744, 300, 2) |
(4368, 300, 2) |
(300, 300) |
| baybike | (8016, 154, 2) |
(744, 154, 2) |
(4368, 154, 2) |
(154, 154) |
| torbike | (8016, 204, 2) |
(744, 204, 2) |
(4368, 204, 2) |
(204, 204) |
Download
huggingface-cli download tjtrans/FORESEE --repo-type dataset --local-dir FORESEE
from huggingface_hub import snapshot_download
snapshot_download(repo_id="tjtrans/FORESEE", repo_type="dataset", local_dir="FORESEE")
Load one split:
import numpy as np
train = np.load("FORESEE/dataset/nycbike/train.npy") # (nodes, days, 24, 2) or (hours, nodes, 2)
adj = np.load("FORESEE/dataset/nycbike/adj_mx.npy")
Reproduce the verified tables (no retraining)
Python >= 3.8. A CUDA GPU is recommended. For CPU, set device: cpu in every file under models/*_config.yaml.
cd FORESEE
pip install -r requirements.txt
python foresee.py
This writes online.csv for the 14 verified STGCN / GWNET dataset pairs. Compare with expected_results/paper_metrics.csv.
Evaluate one backbone:
python eval_reproduce.py --jobs stgcn --out logs/reproduce_stgcn.jsonl --device cuda:0
python eval_reproduce.py --jobs gwnet --out logs/reproduce_gwnet.jsonl --device cuda:0
Included checkpoints:
- STGCN: nycbike, nyctaxi, chibike, chitaxi, bosbike, baybike, torbike
- GWNET: nycbike, nyctaxi, chibike, chitaxi, bosbike, baybike, torbike
FORESEE settings used in the paper
Implemented in foresee.py (Online_day):
- EMA experts:
[0.7, 0.8, 0.9, 1.0] - expert-weight temperature
eta = 10 - graph smoothing
alphainitialized at0.01 - temporal kernel
[0.2, 0.6, 0.2], SGDlr = 0.01 - test batch size = 24 (one day)
- look-back 6 hours, prediction horizon 1 hour
OpenCity (optional)
The STGCN / GWNET tables do not need OpenCity. Fine-tuning script: fintune_opencity.py, configs: opencity/*.yaml. Download the official OpenCity-base.pth yourself and place it at opencity/OpenCity-base.pth.
Citation
@article{foresee2026,
title={Learning from Yesterday's Error: An Efficient Online Learning Method for Traffic Demand Prediction},
journal={Communications in Transportation Research},
year={2026}
}
- Downloads last month
- 33