SpatialEpiBench / README.md
smilegeng's picture
Disable HF viewer and add TsFile data-preview section (viewer: false)
02e353b verified
|
Raw
History Blame Contribute Delete
7.79 kB
---
pretty_name: SpatialEpiBench TsFile
license: cc-by-4.0
tags:
- tabular
- timeseries
- time-series
- geospatial
- epidemiology
- spatial-epidemiology
- epidemic-forecasting
- public-health
- benchmark
- graph
- spatiotemporal
- tsfile
task_categories:
- time-series-forecasting
viewer: false
---
# SpatialEpiBench TsFile
This repository contains a TsFile conversion of the Hugging Face dataset
[`ruiqil/SpatialEpiBench`](https://huggingface.co/datasets/ruiqil/SpatialEpiBench).
The description below separates information taken from the original dataset
card from the changes made during this TsFile conversion.
## ⚠️ About the Dataset Viewer
**The Hugging Face dataset viewer is disabled for this repository on purpose.**
The actual data lives in **11 `.tsfile` files** (Apache IoTDB TsFile, a binary
time-series format). The HF viewer does **not** support `.tsfile`, so it cannot
render the real data. The only files the viewer *could* auto-preview are the
sidecar `.csv` files (`adjacency/*_adj.csv`, `column_mapping.csv`,
`conversion_summary.csv`) — but those are **static graph/metadata tables, not
the time-series data**. Showing them would misrepresent this dataset as having
no timestamps, so the viewer is turned off (`viewer: false`).
Each `.tsfile` does contain a proper time axis. Below is a real preview read
back from `AUcase/AUcase.tsfile` (millisecond `Time` plus regional case counts;
only 4 of 8 regions shown for width):
| Time (epoch ms) | Time (UTC) | australian_capital_territory | new_south_wales | queensland | victoria |
|---:|---|---:|---:|---:|---:|
| 1585699200000 | 2020-04-01 | 4 | 150 | 38 | 51 |
| 1585785600000 | 2020-04-02 | 3 | 116 | 54 | 68 |
| 1585872000000 | 2020-04-03 | 4 | 91 | 38 | 49 |
| 1585958400000 | 2020-04-04 | 2 | 104 | 27 | 30 |
| 1586044800000 | 2020-04-05 | 3 | 87 | 7 | 20 |
To read a `.tsfile`, use the TsFile SDK (Python or Java):
```python
from tsfile import TsFileReader, ColumnCategory
reader = TsFileReader("AUcase/AUcase.tsfile")
schemas = reader.get_all_table_schemas()
table = next(iter(schemas)) # e.g. "aucase"
fields = [c.get_column_name() for c in schemas[table].get_columns()
if c.get_category() in (ColumnCategory.FIELD, ColumnCategory.TAG)]
with reader.query_table(table, fields, batch_size=65536) as rs:
batch = rs.read_arrow_batch() # Arrow batch; includes the `time` column
print(batch.to_pandas().head())
```
## Original Dataset Information
Original dataset: <https://huggingface.co/datasets/ruiqil/SpatialEpiBench>
According to the original dataset README, SpatialEpiBench is a benchmark
collection of 11 spatiotemporal epidemic forecasting datasets. It covers
public-health surveillance modalities including influenza-like illness
surveillance rates, confirmed cases, test positivity, inpatient and
outpatient hospitalizations, hospital admissions, doctor visits, and deaths.
The datasets span the United States, Canada, and Australia, with daily or
weekly temporal resolution depending on the data source.
The original repository provides each time-series dataset as a CSV file,
paired with a corresponding spatial adjacency matrix in a `_adj.csv` file.
The original dataset card declares license `CC-BY-4.0`.
Original dataset overview from the source README:
| Dataset | Frequency | Country | Modality | Time |
|---|---|---|---|---|
| `AUcase` | daily | Australia | cases | 2020-2021 |
| `CAcase` | daily | Canada | cases | 2020-2021 |
| `CANpositivity` | daily | U.S. | test positivity | 2020-2021 |
| `CHNGinpatient` | daily | U.S. | inpatient hospitalizations | 2020-2024 |
| `CHNGoutpatient` | daily | U.S. | outpatient visits | 2020-2024 |
| `CPRadmissions` | daily | U.S. | hospital admissions | 2020-2023 |
| `DVcli` | daily | U.S. | doctor visits | 2020-present |
| `HHShosp` | daily | U.S. | hospitalizations | 2021-2024 |
| `ILI2019` | weekly | U.S. | surveillance rate | 2010-present |
| `JHUcase` | daily | U.S. | cases | 2020-2023 |
| `NCHSdeaths` | weekly | U.S. | deaths | 2020-present |
## Converted Files
Each original time-series CSV was converted into one TsFile. The conversion
keeps the original wide-table layout as closely as possible: each regional
CSV column remains a measurement column in the matching TsFile.
| Source CSV | TsFile | Source rows | Regions | Source time column | First time | Last time | Missing source values | Renamed region columns |
|---|---|---:|---:|---|---|---|---:|---:|
| `AUcase.csv` | `AUcase/AUcase.tsfile` | 640 | 8 | `time_value` | 2020-04-01 | 2021-12-31 | 0 | 5 |
| `CAcase.csv` | `CAcase/CAcase.tsfile` | 640 | 13 | `time_value` | 2020-04-01 | 2021-12-31 | 0 | 6 |
| `CANpositivity.csv` | `CANpositivity/CANpositivity.tsfile` | 642 | 51 | `time_value` | 2020-03-01 | 2021-12-02 | 318 | 0 |
| `CHNGinpatient.csv` | `CHNGinpatient/CHNGinpatient.tsfile` | 1309 | 51 | `time_value` | 2020-01-01 | 2023-08-01 | 34 | 0 |
| `CHNGoutpatient.csv` | `CHNGoutpatient/CHNGoutpatient.tsfile` | 1309 | 51 | `time_value` | 2020-01-01 | 2023-08-01 | 0 | 0 |
| `CPRadmissions.csv` | `CPRadmissions/CPRadmissions.tsfile` | 644 | 51 | `time_value` | 2020-12-16 | 2023-02-21 | 0 | 0 |
| `DVcli.csv` | `DVcli/DVcli.tsfile` | 2162 | 51 | `time_value` | 2020-02-01 | 2026-01-01 | 0 | 0 |
| `HHShosp.csv` | `HHShosp/HHShosp.tsfile` | 978 | 51 | `time_value` | 2021-08-23 | 2024-04-26 | 0 | 0 |
| `ILI2019.csv` | `ILI2019/ILI2019.tsfile` | 481 | 52 | `time` | 2010-10-03 | 2019-12-29 | 0 | 0 |
| `JHUcase.csv` | `JHUcase/JHUcase.tsfile` | 730 | 51 | `time_value` | 2020-04-01 | 2022-03-31 | 0 | 0 |
| `NCHSdeaths.csv` | `NCHSdeaths/NCHSdeaths.tsfile` | 310 | 51 | `time_value` | 2020-01-26 | 2025-12-28 | 991 | 0 |
## Conversion Changes
Compared with the original CSV layout, this conversion made these changes:
- One source time-series CSV was converted to one TsFile, resulting in 11
TsFile files.
- The original date/week column (`time_value`, or `time` for `ILI2019`) was
parsed into the TsFile `Time` column at millisecond precision.
- Regional measurement columns were kept as wide measurement columns.
- Region column names containing spaces or other schema-unsafe characters
were normalized for TsFile/schema parsing, for example spaces were
replaced with underscores. The full mapping is provided in
`column_mapping.csv`.
- Missing numeric values from the source CSV files remain null/missing in
the staged Parquet input. The TsFile import represents these as absent
values for the affected measurement/time.
- The `_adj.csv` spatial adjacency matrices were not written into TsFile
because they are static graph metadata, not time-varying measurements.
They are preserved unchanged under `adjacency/`.
- The original dataset README is included as `SOURCE_DATASET_README.md` for
reference.
No image, video, audio, or other media files were present in the source
repository. The source files are CSV tables.
## Sidecar Files
- `adjacency/*.csv`: original spatial adjacency matrices copied from the
source dataset.
- `column_mapping.csv`: original region column names and their TsFile-safe
measurement names.
- `conversion_summary.csv`: row/region/missing-value summary computed from
the source CSV files used for this conversion.
- `SOURCE_DATASET_README.md`: original Hugging Face dataset README downloaded
from the source repository.
## Validation Summary
- Source value cells across all main CSV files: 450736
- Missing source value cells: 1343
- Region columns renamed for TsFile compatibility: 11
- All 11 generated `.tsfile` files were validated locally as present and
non-empty.