Skip to content

Commit 7bf8729

Browse files
committed
Add more info and example
1 parent 6cf9b26 commit 7bf8729

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

src/datasets/graphs/chickenpox.jl

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,36 @@ The ChickenPox dataset contains county-level chickenpox cases in Hungary between
6060
6161
`ChickenPox` is composed of a graph with nodes representing counties and edges representing the neighborhoods, and a metadata dictionary containing the correspondence between the node indices and the county names.
6262
63-
The node features are the number of weekly chickenpox cases in each county.
63+
The node features are the number of weekly chickenpox cases in each county. They are represented as an array of arrays of size `(1, num_nodes, num_timesteps_in)`. The target values are the number of weekly chickenpox cases in each county. They are represented as an array of arrays of size `(1, num_nodes, num_timesteps_out)`. In both cases. two consecutive arrays are shifted by one-time step.
6464
6565
The dataset was taken from the [Pytorch Geometric Temporal repository](https://pytorch-geometric-temporal.readthedocs.io/en/latest/modules/dataset.html#torch_geometric_temporal.dataset.chickenpox.ChickenpoxDatasetLoader) and more information about the dataset can be found in the paper ["Chickenpox Cases in Hungary: a Benchmark Dataset for
6666
Spatiotemporal Signal Processing with Graph Neural Networks"](https://arxiv.org/pdf/2102.08100).
6767
6868
6969
# Keyword Arguments
7070
- `normalize::Bool`: Whether to normalize the data using Z-score normalization. Default is `true`.
71-
- `num_timesteps_in::Int`: The number of time steps for the input features. Default is `8`.
72-
- `num_timesteps_out::Int`: The number of time steps for the target values. Default is `8`.
71+
- `num_timesteps_in::Int`: The number of time steps, in this case, the number of weeks, for the input features. Default is `8`.
72+
- `num_timesteps_out::Int`: The number of time steps, in this case, the number of weeks, for the target values. Default is `8`.
7373
- `dir::String`: The directory to save the dataset. Default is `nothing`.
74+
75+
# Examples
76+
```julia-repl
77+
julia> using JSON3 # import JSON3
78+
79+
julia> dataset = ChickenPox()
80+
dataset ChickenPox:
81+
metadata => Dict{Symbol, Any} with 20 entries
82+
graphs => 1-element Vector{MLDatasets.Graph}
83+
84+
julia> dataset.graphs[1].num_nodes # 20 counties
85+
20
86+
87+
julia> size(dataset.graphs[1].node_data.features[1])
88+
(1, 20, 8)
89+
90+
julia> dataset.metadata[:BUDAPEST] # The node 5 correponds to Budapest county
91+
5
92+
```
7493
"""
7594
struct ChickenPox <: AbstractDataset
7695
metadata::Dict{Symbol, Any}

0 commit comments

Comments
 (0)