Skip to content

Commit

Permalink
Add instructions on using HDF5 with python.
Browse files Browse the repository at this point in the history
  • Loading branch information
liyaguang committed Mar 17, 2019
1 parent 81b4626 commit 4344ddd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ pip install -r requirements.txt
## Data Preparation
The traffic data files for Los Angeles (METR-LA) and the Bay Area (PEMS-BAY), i.e., `metr-la.h5` and `pems-bay.h5`, are available at [Google Drive](https://drive.google.com/open?id=10FOTa6HXPqX8Pf5WRoRwcFnW9BrNZEIX) or [Baidu Yun](https://pan.baidu.com/s/14Yy9isAIZYdU__OYEQGa_g), and should be
put into the `data/` folder.
Besides, the locations of sensors Los Angeles are available at [data/sensor_graph/graph_sensor_locations.csv](https://github.com/liyaguang/DCRNN/blob/master/data/sensor_graph/graph_sensor_locations.csv).
The `*.h5` files store the data in `panads.DataFrame` using the `HDF5` file format. Here is an article about [Using HDF5 with Python](https://medium.com/@jerilkuriakose/using-hdf5-with-python-6c5242d08773).

```bash
# Create data directories
mkdir -p data/{METR-LA,PEMS-BAY}
Expand All @@ -36,6 +37,7 @@ python -m scripts.generate_training_data --output_dir=data/PEMS-BAY --traffic_df
The generated train/val/test dataset will be saved at `data/{METR-LA,PEMS-BAY}/{train,val,test}.npz`.


The locations of sensors Los Angeles are available at [data/sensor_graph/graph_sensor_locations.csv](https://github.com/liyaguang/DCRNN/blob/master/data/sensor_graph/graph_sensor_locations.csv).
## Run the Pre-trained Model on METR-LA

```bash
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_training_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def main(args):
parser.add_argument(
"--traffic_df_filename",
type=str,
default="data/df_highway_2012_4mon_sample.h5",
default="data/metr-la.h5",
help="Raw traffic readings.",
)
args = parser.parse_args()
Expand Down

0 comments on commit 4344ddd

Please sign in to comment.