Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong sensor IDs for MetrLA? #70

Open
radandreicristian opened this issue Jan 25, 2022 · 8 comments
Open

Wrong sensor IDs for MetrLA? #70

radandreicristian opened this issue Jan 25, 2022 · 8 comments

Comments

@radandreicristian
Copy link

Are the sensors for MetrLA correct? In the file graph_sensor_ids.txt, all the sensor IDs start with 7, but it corresponds neither to the PeMS sensors nor the MetrLA sensors. Is there any use for that file?

@ThomasAFink
Copy link

Great question I also found they start with 7. Also are those the original speed timestamps in metr-la.h5 @liyaguang?

Screenshot 2022-05-06 at 22 30 45

import pandas as pd
import h5py

#h5 file path
filename = 'metr-la.h5'

#read h5 file
dataset = h5py.File(filename, 'r')

#print the first unknown key in the h5 file
print(dataset.keys()) #returns df


#save the h5 file to csv using the first key df
with pd.HDFStore(filename, 'r') as d:
    df = d.get('df')
    df.to_csv('metr-la.csv')

@ThomasAFink
Copy link

The ids in LA distances don't start with 7. https://github.com/liyaguang/DCRNN/blob/master/data/sensor_graph/distances_la_2012.csv

@ThomasAFink
Copy link

The ids in LA distances don't start with 7. https://github.com/liyaguang/DCRNN/blob/master/data/sensor_graph/distances_la_2012.csv

Never-mind they actually do further down the list.

@ThomasAFink
Copy link

Great question I also found they start with 7. Also are those the original speed timestamps in metr-la.h5 @liyaguang?

Screenshot 2022-05-06 at 22 30 45
import pandas as pd
import h5py

#h5 file path
filename = 'metr-la.h5'

#read h5 file
dataset = h5py.File(filename, 'r')

#print the first unknown key in the h5 file
print(dataset.keys()) #returns df


#save the h5 file to csv using the first key df
with pd.HDFStore(filename, 'r') as d:
    df = d.get('df')
    df.to_csv('metr-la.csv')

Okay it's speed data in 5min intervals: https://towardsdatascience.com/build-your-first-graph-neural-network-model-to-predict-traffic-speed-in-20-minutes-b593f8f838e5

@StefanBloemheuvel
Copy link

did anybody find a solution for this? Because now there are 4106 unique sensors in the dataset instead of the 207.

@ThomasAFink
Copy link

No, I got data from another city (Munich) and then built my own adjacency matrix: https://github.com/ThomasAFink/osmnx_adjacency_matrix_for_graph_convolutional_networks

@ThomasAFink
Copy link

Lots of data here from 40 cities: https://utd19.ethz.ch/

@radandreicristian
Copy link
Author

@ThomasAFink @StefanBloemheuvel
Sorry for the (very) late reply. I think I actually managed to get the data right somewhere last year. I actually have a repo where I have tried to get 2 of the datasets in an unified format with latest (back then) versions of NumPy. Everything I found prior to that had some version conflicts about how the data was generated/stored, so I did a remake.

Feel free to use/contribute:

https://github.com/radandreicristian/traffic-datasets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants