witgaw commited on
Commit
ce73f3a
·
verified ·
1 Parent(s): 64f7d4d

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -22
README.md CHANGED
@@ -21,19 +21,22 @@ This dataset contains traffic flow data for time series forecasting tasks, commo
21
  ## Dataset Structure
22
 
23
  ### Data Format
 
24
  - **Format**: Parquet files for efficient loading and analysis
25
  - **Splits**: train (70%), validation (10%), test (20%) - **temporal splits** preserving chronological order
26
  - **Features**: Time series traffic flow data with temporal and spatial dimensions
27
 
28
  ### Split Strategy
 
29
  - **Temporal splitting**: Data is split chronologically to prevent data leakage
30
  - **All sensors included**: Each split contains data for all sensors at each time step
31
  - **Training period**: Earliest 70% of time samples across all sensors
32
- - **Validation period**: Next 10% of time samples across all sensors
33
  - **Test period**: Latest 20% of time samples across all sensors
34
  - **Graph structure preserved**: Spatial relationships maintained in all splits
35
 
36
  ### Data Schema
 
37
  - `node_id`: Sensor/node identifier (0-206 for METR-LA, 0-324 for PEMS-BAY)
38
  - `x_t*_d*`: Input features at different time offsets and dimensions
39
  - `x_t-11_d0` to `x_t+0_d0`: Traffic flow values at 12 historical time steps
@@ -43,8 +46,9 @@ This dataset contains traffic flow data for time series forecasting tasks, commo
43
  - `y_t+1_d1` to `y_t+12_d1`: Time-of-day features for prediction horizon
44
 
45
  ### Dataset Statistics
 
46
  - **Total time series samples**: ~34K (METR-LA) / ~52K (PEMS-BAY)
47
- - **Total records**: ~7M (METR-LA) / ~17M (PEMS-BAY)
48
  - **Records per sample**: 207 (METR-LA) / 325 (PEMS-BAY) sensors
49
  - **Temporal resolution**: 5-minute intervals
50
  - **Prediction horizon**: 1 hour (12 time steps)
@@ -52,24 +56,23 @@ This dataset contains traffic flow data for time series forecasting tasks, commo
52
  ## Usage
53
 
54
  ```python
55
- from datasets import load_dataset
56
  import pandas as pd
57
 
58
- # Load from Hugging Face Hub
59
- dataset = load_dataset("witgaw/METR-LA")
60
-
61
- # Or load locally
62
- train_df = pd.read_parquet("train.parquet")
63
- val_df = pd.read_parquet("val.parquet")
64
- test_df = pd.read_parquet("test.parquet")
65
 
66
- print(f"Train samples: {len(train_df) // 207:,}") # Divide by number of sensors
67
- print(f"Total records: {len(train_df):,}")
68
- print(f"Features per record: {len(train_df.columns)}")
 
 
69
 
70
- # Example: Get data for first time sample
71
- first_sample = train_df[train_df.index < 207] # First 207 records (all sensors)
72
- print(f"Shape for one time sample: {first_sample.shape}")
73
  ```
74
 
75
  ## Citation
@@ -77,11 +80,11 @@ print(f"Shape for one time sample: {first_sample.shape}")
77
  If you use this dataset, please cite the original DCRNN paper:
78
 
79
  ```bibtex
80
- @inproceedings{li2018dcrnn,
81
- title={Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting},
82
- author={Li, Yaguang and Yu, Rose and Shahabi, Cyrus and Liu, Yan},
83
- booktitle={International Conference on Learning Representations},
84
- year={2018}
85
  }
86
  ```
87
 
@@ -95,4 +98,4 @@ This dataset is derived from the original METR-LA dataset used in the DCRNN pape
95
 
96
  ## License
97
 
98
- MIT License - See LICENSE file for details.
 
21
  ## Dataset Structure
22
 
23
  ### Data Format
24
+
25
  - **Format**: Parquet files for efficient loading and analysis
26
  - **Splits**: train (70%), validation (10%), test (20%) - **temporal splits** preserving chronological order
27
  - **Features**: Time series traffic flow data with temporal and spatial dimensions
28
 
29
  ### Split Strategy
30
+
31
  - **Temporal splitting**: Data is split chronologically to prevent data leakage
32
  - **All sensors included**: Each split contains data for all sensors at each time step
33
  - **Training period**: Earliest 70% of time samples across all sensors
34
+ - **Validation period**: Next 10% of time samples across all sensors
35
  - **Test period**: Latest 20% of time samples across all sensors
36
  - **Graph structure preserved**: Spatial relationships maintained in all splits
37
 
38
  ### Data Schema
39
+
40
  - `node_id`: Sensor/node identifier (0-206 for METR-LA, 0-324 for PEMS-BAY)
41
  - `x_t*_d*`: Input features at different time offsets and dimensions
42
  - `x_t-11_d0` to `x_t+0_d0`: Traffic flow values at 12 historical time steps
 
46
  - `y_t+1_d1` to `y_t+12_d1`: Time-of-day features for prediction horizon
47
 
48
  ### Dataset Statistics
49
+
50
  - **Total time series samples**: ~34K (METR-LA) / ~52K (PEMS-BAY)
51
+ - **Total records**: ~7M (METR-LA) / ~17M (PEMS-BAY)
52
  - **Records per sample**: 207 (METR-LA) / 325 (PEMS-BAY) sensors
53
  - **Temporal resolution**: 5-minute intervals
54
  - **Prediction horizon**: 1 hour (12 time steps)
 
56
  ## Usage
57
 
58
  ```python
59
+ from datasets import Dataset, DatasetDict
60
  import pandas as pd
61
 
62
+ # Load from local parquet files
63
+ train_df = pd.read_parquet("METR-LA/train.parquet")
64
+ val_df = pd.read_parquet("METR-LA/val.parquet")
65
+ test_df = pd.read_parquet("METR-LA/test.parquet")
 
 
 
66
 
67
+ ds = DatasetDict({
68
+ "train": Dataset.from_pandas(train_df, preserve_index=False),
69
+ "val": Dataset.from_pandas(val_df, preserve_index=False),
70
+ "test": Dataset.from_pandas(test_df, preserve_index=False)
71
+ })
72
 
73
+ print(f"Train records: {len(ds['train']):,}")
74
+ print(f"Val records: {len(ds['val']):,}")
75
+ print(f"Test records: {len(ds['test']):,}")
76
  ```
77
 
78
  ## Citation
 
80
  If you use this dataset, please cite the original DCRNN paper:
81
 
82
  ```bibtex
83
+ @inproceedings{li2018dcrnn_traffic,
84
+ title={{Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting}},
85
+ author={{Li, Yaguang and Yu, Rose and Shahabi, Cyrus and Liu, Yan}},
86
+ booktitle={{International Conference on Learning Representations}},
87
+ year={{2018}}
88
  }
89
  ```
90
 
 
98
 
99
  ## License
100
 
101
+ MIT License - See the [original repository LICENSE](https://github.com/liyaguang/DCRNN/blob/master/LICENSE) for details.