mindspore_gl.dataset.MetrLa
- class mindspore_gl.dataset.MetrLa(root)[source]
METR-LA Dataset, a source dataset for reading and parsing METR-LA dataset.
About METR-LA dataset:
METR-LA is a large-scale dataset collected from 1500 traffic loop detectors in Los Angeles country road network. This dataset includes speed, volume and occupancy data, covering approximately 3,420 miles.
Statistics:
Time step: 12,6850
Nodes: 207
Edges: 1515
Dataset can be download here: METR-LA .
You can organize the dataset files into the following directory structure and read by mindspore_gl.dataset.MetrLa.get_data API.
. ├── adj_mat.npy └── node_values.npy
- Parameters
root (str) – path to the root directory that contains METR-LA/adj_mat.npy and METR-LA/node_values.npy.
- Inputs:
in_timestep (int) - numbers of input time sequence.
out_timestep (int) - numbers of output time sequence.
- Raises
TypeError – if root is not a str.
RuntimeError – if root does not contain data files.
TypeError – If in_timestep or out_timestep is not a positive int.
Examples
>>> from mindspore_gl.dataset.ppi import MetrLa >>> root = "path/to/metrla" >>> dataset = MetrLa(root) >>> features, labels = dataset.get_data(in_timestep, out_timestep)
- property node_count
Number of nodes.
- Returns
int, number of node.
Examples
>>> #dataset is an instance object of Dataset >>> node_count = dataset.node_count