Datasets:
Anonymous Authors commited on
Commit ·
a498c8b
1
Parent(s): a5607d4
Anonymous WildfireIA canonical dataset release
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +0 -56
- DATA_LICENSES.md +16 -0
- README.md +73 -0
- UPLOAD_INSTRUCTIONS.md +21 -0
- code/dataloader.py +1459 -0
- code/summarize_task1_full_all_seeds.py +97 -0
- code/summarize_task2_full_all_seeds.py +95 -0
- code/train.py +0 -0
- croissant.json +529 -0
- data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2016/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2017/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2018/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2019/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2020/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2016/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2017/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2018/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2019/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2020/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_patch_manifest_375m_natural.json +23 -0
- data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2016/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2017/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2018/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2019/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2020/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2016/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2017/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2018/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2019/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2020/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2016/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2017/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2018/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2019/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2020/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-1/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-2/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-3/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-4/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=0/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-1/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-2/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-3/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-4/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=0/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-1/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-2/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-3/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-4/part-0.parquet +3 -0
- data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=0/part-0.parquet +3 -0
.gitattributes
CHANGED
|
@@ -1,60 +1,4 @@
|
|
| 1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
-
*.avro filter=lfs diff=lfs merge=lfs -text
|
| 4 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 5 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 6 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 17 |
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 18 |
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 21 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 25 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 33 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 36 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 37 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 38 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 39 |
-
# Audio files - uncompressed
|
| 40 |
-
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 41 |
-
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 42 |
-
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 43 |
-
# Audio files - compressed
|
| 44 |
-
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
-
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 46 |
-
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 47 |
-
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 48 |
-
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 49 |
-
# Image files - uncompressed
|
| 50 |
-
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 51 |
-
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 52 |
-
*.png filter=lfs diff=lfs merge=lfs -text
|
| 53 |
-
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 54 |
-
# Image files - compressed
|
| 55 |
-
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
-
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 57 |
-
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 58 |
-
# Video files - compressed
|
| 59 |
-
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
-
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 2 |
*.npz filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
| 3 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
| 4 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DATA_LICENSES.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Data Licenses and Provenance
|
| 2 |
+
|
| 3 |
+
This release is a derived benchmark artifact built from public data sources.
|
| 4 |
+
Source-specific terms still apply.
|
| 5 |
+
|
| 6 |
+
- FPA-FOD wildfire occurrence data: USDA Forest Service Research Data Archive.
|
| 7 |
+
- FIRMS/VIIRS active fire detections: NASA FIRMS.
|
| 8 |
+
- gridMET meteorology and fire-danger variables.
|
| 9 |
+
- LANDFIRE vegetation, fuel, and topography rasters.
|
| 10 |
+
- OpenStreetMap roads and fire-station features. OSM-derived access features
|
| 11 |
+
are subject to OpenStreetMap/ODbL terms.
|
| 12 |
+
- WorldPop population rasters.
|
| 13 |
+
|
| 14 |
+
The code in `code/` may be redistributed under the repository license chosen
|
| 15 |
+
for the anonymous submission. The data are distributed under source-compatible
|
| 16 |
+
terms rather than a single newly asserted license.
|
README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
pretty_name: WildfireIA Anonymous Benchmark Release
|
| 4 |
+
task_categories:
|
| 5 |
+
- tabular-classification
|
| 6 |
+
- tabular-regression
|
| 7 |
+
- time-series-classification
|
| 8 |
+
- image-classification
|
| 9 |
+
tags:
|
| 10 |
+
- wildfire
|
| 11 |
+
- benchmark
|
| 12 |
+
- geospatial
|
| 13 |
+
- multimodal
|
| 14 |
+
- croissant
|
| 15 |
+
size_categories:
|
| 16 |
+
- 10K<n<100K
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# WildfireIA Anonymous Benchmark Release
|
| 20 |
+
|
| 21 |
+
This anonymous release contains the WildfireIA benchmark data used for review.
|
| 22 |
+
WildfireIA is an event-level benchmark for predicting whether a reported
|
| 23 |
+
Natural wildfire escapes initial attack from public information available at
|
| 24 |
+
fire discovery time.
|
| 25 |
+
|
| 26 |
+
## Contents
|
| 27 |
+
|
| 28 |
+
- `data/canonical/raw_feature_tables/`: canonical benchmark tables. These are
|
| 29 |
+
the primary dataset artifact. They contain event-level tables, source-level
|
| 30 |
+
feature tables, patch-level canonical tables, labels, splits, and manifests.
|
| 31 |
+
- Model-ready caches are not included in this compact release; regenerate
|
| 32 |
+
them deterministically from the canonical tables with `code/dataloader.py`.
|
| 33 |
+
- `code/`: anonymous copies of the cache generation, training, and summary
|
| 34 |
+
scripts.
|
| 35 |
+
- `metadata/`: release manifest and cache generation commands.
|
| 36 |
+
- `croissant.json`: Croissant metadata with Responsible AI fields.
|
| 37 |
+
|
| 38 |
+
## Tasks
|
| 39 |
+
|
| 40 |
+
Task 1 predicts initial attack failure. The sample unit is one FPA-FOD Natural
|
| 41 |
+
wildfire event. Events with final size at most 10 ha are labeled 0, events with
|
| 42 |
+
final size at least 50 ha are labeled 1, and intermediate-size events are
|
| 43 |
+
excluded from the Task 1 supervised split.
|
| 44 |
+
|
| 45 |
+
Task 2 predicts remaining time-to-containment as a regression target,
|
| 46 |
+
`log(1 + containment_hours)`, using the same discovery-time input contract.
|
| 47 |
+
|
| 48 |
+
## Rebuilding Model-Ready Caches
|
| 49 |
+
|
| 50 |
+
The canonical tables can regenerate all official model-ready caches:
|
| 51 |
+
|
| 52 |
+
```bash
|
| 53 |
+
python code/dataloader.py \
|
| 54 |
+
--base_dir . \
|
| 55 |
+
--canonical_dir data/canonical/raw_feature_tables \
|
| 56 |
+
--output_dir data/model_ready \
|
| 57 |
+
--task ia_failure \
|
| 58 |
+
--representation all \
|
| 59 |
+
--weather_days 5 \
|
| 60 |
+
--input_protocol all \
|
| 61 |
+
--overwrite
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
Additional ablation caches are generated by changing `--input_protocol` and
|
| 65 |
+
`--weather_days`; see `metadata/cache_generation_commands.md`.
|
| 66 |
+
|
| 67 |
+
## Responsible Use
|
| 68 |
+
|
| 69 |
+
The benchmark is intended for reproducible scientific comparison and ablation
|
| 70 |
+
analysis. It should not be used as a standalone operational dispatch system
|
| 71 |
+
without agency validation. The data are public-source derived, but they include
|
| 72 |
+
wildfire locations, fire-station locations, roads, population density, and other
|
| 73 |
+
geospatial context.
|
UPLOAD_INSTRUCTIONS.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Upload Instructions
|
| 2 |
+
|
| 3 |
+
This folder is a staging copy for the anonymous Hugging Face dataset repository.
|
| 4 |
+
|
| 5 |
+
Recommended upload workflow:
|
| 6 |
+
|
| 7 |
+
```bash
|
| 8 |
+
cd <local-project-root>
|
| 9 |
+
git xet install
|
| 10 |
+
git clone <anonymous-huggingface-dataset-ssh-url> <hf-clone>
|
| 11 |
+
rsync -a --info=progress2 <staging-folder>/ <hf-clone>/
|
| 12 |
+
cd <hf-clone>
|
| 13 |
+
git status --short
|
| 14 |
+
git add .
|
| 15 |
+
git commit -m "Anonymous WildfireIA dataset release"
|
| 16 |
+
git push
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
Before pushing, run a local identity scan for personal names, local usernames,
|
| 20 |
+
absolute machine paths, affiliations, and email addresses. The release should
|
| 21 |
+
only contain anonymous creator metadata during review.
|
code/dataloader.py
ADDED
|
@@ -0,0 +1,1459 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
import json
|
| 5 |
+
import shutil
|
| 6 |
+
from datetime import datetime, timezone
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
from typing import Iterable
|
| 9 |
+
|
| 10 |
+
import numpy as np
|
| 11 |
+
import pandas as pd
|
| 12 |
+
from sklearn.preprocessing import StandardScaler
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
PROJECT_ROOT = Path(".")
|
| 16 |
+
PATCH_SIZE = 29
|
| 17 |
+
CELLS_PER_PATCH = PATCH_SIZE * PATCH_SIZE
|
| 18 |
+
WEATHER_DAY_MAP = {
|
| 19 |
+
1: [0],
|
| 20 |
+
2: [-1, 0],
|
| 21 |
+
3: [-2, -1, 0],
|
| 22 |
+
4: [-3, -2, -1, 0],
|
| 23 |
+
5: [-4, -3, -2, -1, 0],
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
TASKS = {
|
| 27 |
+
"ia_failure": {
|
| 28 |
+
"target_column": "ia_failure_label",
|
| 29 |
+
"task_type": "binary_classification",
|
| 30 |
+
"raw_column": None,
|
| 31 |
+
},
|
| 32 |
+
"containment_time": {
|
| 33 |
+
"target_column": "log_containment_hours",
|
| 34 |
+
"task_type": "regression",
|
| 35 |
+
"raw_column": "containment_hours",
|
| 36 |
+
},
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
PROTOCOL_GROUPS = {
|
| 40 |
+
"metadata": ["metadata"],
|
| 41 |
+
"firms": ["fire_strict"],
|
| 42 |
+
"fire": ["fire_strict"],
|
| 43 |
+
"fire_wide": ["fire_strict", "fire_wide"],
|
| 44 |
+
"weather": ["weather_aggregate", "fire_danger_aggregate"],
|
| 45 |
+
"fuel": ["fuel"],
|
| 46 |
+
"vegetation": ["vegetation"],
|
| 47 |
+
"topography": ["topography"],
|
| 48 |
+
"access": ["access"],
|
| 49 |
+
"human": ["human"],
|
| 50 |
+
"metadata_vegetation": ["metadata", "vegetation"],
|
| 51 |
+
"metadata_fuel": ["metadata", "fuel"],
|
| 52 |
+
"metadata_topography": ["metadata", "topography"],
|
| 53 |
+
"metadata_access": ["metadata", "access"],
|
| 54 |
+
"metadata_human": ["metadata", "human"],
|
| 55 |
+
"all": [
|
| 56 |
+
"metadata",
|
| 57 |
+
"fire_strict",
|
| 58 |
+
"weather_aggregate",
|
| 59 |
+
"fire_danger_aggregate",
|
| 60 |
+
"fuel",
|
| 61 |
+
"vegetation",
|
| 62 |
+
"topography",
|
| 63 |
+
"access",
|
| 64 |
+
"human",
|
| 65 |
+
],
|
| 66 |
+
"all_without_fire": [
|
| 67 |
+
"metadata",
|
| 68 |
+
"weather_aggregate",
|
| 69 |
+
"fire_danger_aggregate",
|
| 70 |
+
"fuel",
|
| 71 |
+
"vegetation",
|
| 72 |
+
"topography",
|
| 73 |
+
"access",
|
| 74 |
+
"human",
|
| 75 |
+
],
|
| 76 |
+
"all_without_weather": [
|
| 77 |
+
"metadata",
|
| 78 |
+
"fire_strict",
|
| 79 |
+
"fuel",
|
| 80 |
+
"vegetation",
|
| 81 |
+
"topography",
|
| 82 |
+
"access",
|
| 83 |
+
"human",
|
| 84 |
+
],
|
| 85 |
+
"all_without_vegetation": [
|
| 86 |
+
"metadata",
|
| 87 |
+
"fire_strict",
|
| 88 |
+
"weather_aggregate",
|
| 89 |
+
"fire_danger_aggregate",
|
| 90 |
+
"fuel",
|
| 91 |
+
"topography",
|
| 92 |
+
"access",
|
| 93 |
+
"human",
|
| 94 |
+
],
|
| 95 |
+
"all_without_fuel": [
|
| 96 |
+
"metadata",
|
| 97 |
+
"fire_strict",
|
| 98 |
+
"weather_aggregate",
|
| 99 |
+
"fire_danger_aggregate",
|
| 100 |
+
"vegetation",
|
| 101 |
+
"topography",
|
| 102 |
+
"access",
|
| 103 |
+
"human",
|
| 104 |
+
],
|
| 105 |
+
"all_without_topography": [
|
| 106 |
+
"metadata",
|
| 107 |
+
"fire_strict",
|
| 108 |
+
"weather_aggregate",
|
| 109 |
+
"fire_danger_aggregate",
|
| 110 |
+
"fuel",
|
| 111 |
+
"vegetation",
|
| 112 |
+
"access",
|
| 113 |
+
"human",
|
| 114 |
+
],
|
| 115 |
+
"all_without_access": [
|
| 116 |
+
"metadata",
|
| 117 |
+
"fire_strict",
|
| 118 |
+
"weather_aggregate",
|
| 119 |
+
"fire_danger_aggregate",
|
| 120 |
+
"fuel",
|
| 121 |
+
"vegetation",
|
| 122 |
+
"topography",
|
| 123 |
+
"human",
|
| 124 |
+
],
|
| 125 |
+
"all_without_human": [
|
| 126 |
+
"metadata",
|
| 127 |
+
"fire_strict",
|
| 128 |
+
"weather_aggregate",
|
| 129 |
+
"fire_danger_aggregate",
|
| 130 |
+
"fuel",
|
| 131 |
+
"vegetation",
|
| 132 |
+
"topography",
|
| 133 |
+
"access",
|
| 134 |
+
],
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
TEMPORAL_WEATHER_CHANNELS = [
|
| 138 |
+
"tmmx",
|
| 139 |
+
"tmmn",
|
| 140 |
+
"pr",
|
| 141 |
+
"rmax",
|
| 142 |
+
"rmin",
|
| 143 |
+
"sph",
|
| 144 |
+
"vpd",
|
| 145 |
+
"vs",
|
| 146 |
+
"srad",
|
| 147 |
+
"erc",
|
| 148 |
+
"bi",
|
| 149 |
+
"fm100",
|
| 150 |
+
"fm1000",
|
| 151 |
+
"wind_dir_sin",
|
| 152 |
+
"wind_dir_cos",
|
| 153 |
+
]
|
| 154 |
+
|
| 155 |
+
FUEL_PATCH_CHANNELS = ["fbfm40", "cbd", "cbh", "cc", "ch", "fd", "fvt", "fvc", "fvh"]
|
| 156 |
+
VEGETATION_PATCH_CHANNELS = ["evt", "evc", "evh"]
|
| 157 |
+
STATIC_PATCH_CHANNELS = [*FUEL_PATCH_CHANNELS, *VEGETATION_PATCH_CHANNELS, "elev", "slope", "aspect_sin", "aspect_cos", "pop_density"]
|
| 158 |
+
VIIRS_PATCH_CHANNELS = [
|
| 159 |
+
"viirs_cell_count_D",
|
| 160 |
+
"viirs_cell_sum_frp_D",
|
| 161 |
+
"viirs_cell_max_frp_D",
|
| 162 |
+
"viirs_cell_mean_frp_D",
|
| 163 |
+
"viirs_cell_max_bright_ti4_D",
|
| 164 |
+
"viirs_cell_mean_bright_ti4_D",
|
| 165 |
+
"viirs_cell_day_count_D",
|
| 166 |
+
"viirs_cell_night_count_D",
|
| 167 |
+
"viirs_cell_has_detection_D",
|
| 168 |
+
]
|
| 169 |
+
OSM_PATCH_CHANNELS = [
|
| 170 |
+
"cell_distance_to_nearest_drivable_road_m",
|
| 171 |
+
"cell_distance_to_nearest_fire_station_m",
|
| 172 |
+
"cell_road_length_375m_m",
|
| 173 |
+
"cell_has_drivable_road",
|
| 174 |
+
"cell_distance_to_nearest_major_road_m",
|
| 175 |
+
"cell_distance_to_nearest_track_or_service_road_m",
|
| 176 |
+
]
|
| 177 |
+
TOPO_PATCH_CHANNELS = ["elev", "slope", "aspect_sin", "aspect_cos"]
|
| 178 |
+
PATCH_METADATA_CHANNELS = ["lat", "lon", "discovery_month", "discovery_doy", "discovery_hour"]
|
| 179 |
+
|
| 180 |
+
KNOWN_CATEGORICAL_COLUMNS = {
|
| 181 |
+
"state",
|
| 182 |
+
"county",
|
| 183 |
+
"cause_classification",
|
| 184 |
+
"general_cause",
|
| 185 |
+
"fbfm40_point",
|
| 186 |
+
"fd_point",
|
| 187 |
+
"fvt_point",
|
| 188 |
+
"fvc_point",
|
| 189 |
+
"fvh_point",
|
| 190 |
+
"evt_point",
|
| 191 |
+
"evc_point",
|
| 192 |
+
"evh_point",
|
| 193 |
+
"fbfm40_mode_1km",
|
| 194 |
+
"fbfm40_mode_3km",
|
| 195 |
+
"fbfm40_mode_5km",
|
| 196 |
+
"fd_mode_1km",
|
| 197 |
+
"fd_mode_3km",
|
| 198 |
+
"fd_mode_5km",
|
| 199 |
+
"fvt_mode_1km",
|
| 200 |
+
"fvt_mode_3km",
|
| 201 |
+
"fvt_mode_5km",
|
| 202 |
+
"fvc_mode_1km",
|
| 203 |
+
"fvc_mode_3km",
|
| 204 |
+
"fvc_mode_5km",
|
| 205 |
+
"fvh_mode_1km",
|
| 206 |
+
"fvh_mode_3km",
|
| 207 |
+
"fvh_mode_5km",
|
| 208 |
+
"evt_mode_1km",
|
| 209 |
+
"evt_mode_3km",
|
| 210 |
+
"evt_mode_5km",
|
| 211 |
+
"evc_mode_1km",
|
| 212 |
+
"evc_mode_3km",
|
| 213 |
+
"evc_mode_5km",
|
| 214 |
+
"evh_mode_1km",
|
| 215 |
+
"evh_mode_3km",
|
| 216 |
+
"evh_mode_5km",
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
CORE_INDEX_COLUMNS = {"fire_id", "year", "split"}
|
| 220 |
+
|
| 221 |
+
|
| 222 |
+
def protocol_groups(input_protocol: str) -> list[str]:
|
| 223 |
+
if input_protocol not in PROTOCOL_GROUPS:
|
| 224 |
+
raise KeyError(f"Unknown input_protocol: {input_protocol}")
|
| 225 |
+
return PROTOCOL_GROUPS[input_protocol]
|
| 226 |
+
|
| 227 |
+
|
| 228 |
+
def protocol_includes_weather(input_protocol: str) -> bool:
|
| 229 |
+
groups = protocol_groups(input_protocol)
|
| 230 |
+
return "weather_aggregate" in groups or "fire_danger_aggregate" in groups
|
| 231 |
+
|
| 232 |
+
|
| 233 |
+
def ensure_project_path(path: Path) -> Path:
|
| 234 |
+
resolved = path.resolve()
|
| 235 |
+
if not str(resolved).startswith(str(PROJECT_ROOT)):
|
| 236 |
+
raise ValueError(f"Path must stay inside {PROJECT_ROOT}: {resolved}")
|
| 237 |
+
return resolved
|
| 238 |
+
|
| 239 |
+
|
| 240 |
+
def load_json(path: Path) -> dict:
|
| 241 |
+
with path.open("r", encoding="utf-8") as file:
|
| 242 |
+
return json.load(file)
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
def write_json(path: Path, payload: dict) -> None:
|
| 246 |
+
path.parent.mkdir(parents=True, exist_ok=True)
|
| 247 |
+
with path.open("w", encoding="utf-8") as file:
|
| 248 |
+
json.dump(payload, file, indent=2, sort_keys=True)
|
| 249 |
+
file.write("\n")
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
def remove_output_dir(path: Path, overwrite: bool) -> None:
|
| 253 |
+
if path.exists() and overwrite:
|
| 254 |
+
shutil.rmtree(path)
|
| 255 |
+
path.mkdir(parents=True, exist_ok=True)
|
| 256 |
+
|
| 257 |
+
|
| 258 |
+
def created_at() -> str:
|
| 259 |
+
return datetime.now(timezone.utc).isoformat()
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
def canonical_paths(canonical_dir: Path) -> dict[str, Path]:
|
| 263 |
+
return {
|
| 264 |
+
"master": canonical_dir / "master_features_natural_2016_2020.parquet",
|
| 265 |
+
"weather_daily_event": canonical_dir / "gridmet_daily_event_features_natural_2016_2020.parquet",
|
| 266 |
+
"grid_index": canonical_dir / "event_grid_375m_index_natural_2016_2020.parquet",
|
| 267 |
+
"static_patch": canonical_dir / "event_static_patch_375m_natural_2016_2020.parquet",
|
| 268 |
+
"viirs_patch": canonical_dir / "event_viirs_patch_375m_D_natural_2016_2020.parquet",
|
| 269 |
+
"weather_daily_patch": canonical_dir / "event_weather_daily_patch_375m_natural_2016_2020.parquet",
|
| 270 |
+
"weather_aggregate_patch": canonical_dir / "event_weather_aggregate_patch_375m_natural_2016_2020.parquet",
|
| 271 |
+
"osm_patch": canonical_dir / "event_osm_patch_375m_natural_2016_2020.parquet",
|
| 272 |
+
"feature_manifest": canonical_dir / "feature_manifest_natural.json",
|
| 273 |
+
"label_manifest": canonical_dir / "label_manifest_natural.json",
|
| 274 |
+
"patch_manifest": canonical_dir / "event_patch_manifest_375m_natural.json",
|
| 275 |
+
"temporal_manifest": canonical_dir / "temporal_protocol_manifest_natural.json",
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
|
| 279 |
+
def required_path_keys() -> list[str]:
|
| 280 |
+
return [
|
| 281 |
+
"master",
|
| 282 |
+
"weather_daily_event",
|
| 283 |
+
"grid_index",
|
| 284 |
+
"static_patch",
|
| 285 |
+
"viirs_patch",
|
| 286 |
+
"weather_daily_patch",
|
| 287 |
+
"weather_aggregate_patch",
|
| 288 |
+
"osm_patch",
|
| 289 |
+
"feature_manifest",
|
| 290 |
+
"label_manifest",
|
| 291 |
+
"patch_manifest",
|
| 292 |
+
"temporal_manifest",
|
| 293 |
+
]
|
| 294 |
+
|
| 295 |
+
|
| 296 |
+
def load_manifests(paths: dict[str, Path]) -> tuple[dict, dict, dict, dict]:
|
| 297 |
+
return (
|
| 298 |
+
load_json(paths["feature_manifest"]),
|
| 299 |
+
load_json(paths["label_manifest"]),
|
| 300 |
+
load_json(paths["patch_manifest"]),
|
| 301 |
+
load_json(paths["temporal_manifest"]),
|
| 302 |
+
)
|
| 303 |
+
|
| 304 |
+
|
| 305 |
+
def output_subdir(output_dir: Path, task: str, representation: str, weather_days: int, input_protocol: str) -> Path:
|
| 306 |
+
return output_dir / task / representation / f"weather{weather_days}_{input_protocol}"
|
| 307 |
+
|
| 308 |
+
|
| 309 |
+
def target_info(task: str) -> dict:
|
| 310 |
+
if task not in TASKS:
|
| 311 |
+
raise KeyError(f"Unknown task: {task}")
|
| 312 |
+
return TASKS[task]
|
| 313 |
+
|
| 314 |
+
|
| 315 |
+
def filter_task_samples(master: pd.DataFrame, task: str) -> pd.DataFrame:
|
| 316 |
+
info = target_info(task)
|
| 317 |
+
target_col = info["target_column"]
|
| 318 |
+
if target_col not in master.columns:
|
| 319 |
+
raise KeyError(f"Target column not found in master_features: {target_col}")
|
| 320 |
+
filtered = master.loc[master[target_col].notna()].copy()
|
| 321 |
+
filtered["target"] = filtered[target_col]
|
| 322 |
+
if task == "ia_failure":
|
| 323 |
+
filtered["target"] = filtered["target"].astype(int)
|
| 324 |
+
return filtered
|
| 325 |
+
|
| 326 |
+
|
| 327 |
+
def apply_input_protocol_sample_filter(samples: pd.DataFrame, input_protocol: str) -> pd.DataFrame:
|
| 328 |
+
"""Apply protocol-level sample restrictions without changing task labels."""
|
| 329 |
+
if input_protocol != "firms":
|
| 330 |
+
return samples
|
| 331 |
+
match_col = "viirs_num_assigned_detections_D"
|
| 332 |
+
fallback_col = "has_viirs_detection_1km_D"
|
| 333 |
+
filtered = samples.copy()
|
| 334 |
+
if match_col in filtered.columns:
|
| 335 |
+
mask = pd.to_numeric(filtered[match_col], errors="coerce").fillna(0) > 0
|
| 336 |
+
elif fallback_col in filtered.columns:
|
| 337 |
+
mask = pd.to_numeric(filtered[fallback_col], errors="coerce").fillna(0) > 0
|
| 338 |
+
else:
|
| 339 |
+
raise KeyError(
|
| 340 |
+
"input_protocol=firms requires viirs_num_assigned_detections_D "
|
| 341 |
+
"or has_viirs_detection_1km_D in master_features."
|
| 342 |
+
)
|
| 343 |
+
before = len(filtered)
|
| 344 |
+
filtered = filtered.loc[mask].copy()
|
| 345 |
+
print(f"FIRMS-only sample filter retained {len(filtered)} / {before} task samples.")
|
| 346 |
+
return filtered
|
| 347 |
+
|
| 348 |
+
|
| 349 |
+
def normalize_master_metadata(master: pd.DataFrame) -> pd.DataFrame:
|
| 350 |
+
master = master.copy()
|
| 351 |
+
if "year" not in master.columns:
|
| 352 |
+
for candidate in ["year_x", "year_y", "FIRE_YEAR"]:
|
| 353 |
+
if candidate in master.columns:
|
| 354 |
+
master["year"] = master[candidate]
|
| 355 |
+
break
|
| 356 |
+
if "split" not in master.columns and "split_x" in master.columns:
|
| 357 |
+
master["split"] = master["split_x"]
|
| 358 |
+
if "year" in master.columns:
|
| 359 |
+
master["year"] = pd.to_numeric(master["year"], errors="coerce").astype("Int64")
|
| 360 |
+
return master
|
| 361 |
+
|
| 362 |
+
|
| 363 |
+
def build_sample_index(samples: pd.DataFrame, master: pd.DataFrame, task: str) -> pd.DataFrame:
|
| 364 |
+
samples = normalize_master_metadata(samples)
|
| 365 |
+
master = normalize_master_metadata(master)
|
| 366 |
+
info = target_info(task)
|
| 367 |
+
target_col = info["target_column"]
|
| 368 |
+
raw_col = info["raw_column"]
|
| 369 |
+
sample_index = samples.copy()
|
| 370 |
+
recover_cols = ["fire_id", "year", "split", target_col]
|
| 371 |
+
if raw_col:
|
| 372 |
+
recover_cols.append(raw_col)
|
| 373 |
+
missing = [col for col in recover_cols if col not in sample_index.columns]
|
| 374 |
+
if missing:
|
| 375 |
+
recovered = master[[col for col in recover_cols if col in master.columns]].copy()
|
| 376 |
+
recovered["fire_id"] = recovered["fire_id"].astype(str)
|
| 377 |
+
sample_index["fire_id"] = sample_index["fire_id"].astype(str)
|
| 378 |
+
sample_index = sample_index.merge(recovered, on="fire_id", how="left", suffixes=("", "_from_master"))
|
| 379 |
+
for col in missing:
|
| 380 |
+
from_master = f"{col}_from_master"
|
| 381 |
+
if from_master in sample_index.columns:
|
| 382 |
+
sample_index[col] = sample_index[from_master]
|
| 383 |
+
|
| 384 |
+
if target_col not in sample_index.columns and "target" in sample_index.columns:
|
| 385 |
+
sample_index[target_col] = sample_index["target"]
|
| 386 |
+
required = ["fire_id", "year", "split", target_col]
|
| 387 |
+
if raw_col:
|
| 388 |
+
required.append(raw_col)
|
| 389 |
+
still_missing = [col for col in required if col not in sample_index.columns]
|
| 390 |
+
if still_missing:
|
| 391 |
+
raise KeyError(f"Sample index is missing required metadata columns: {still_missing}")
|
| 392 |
+
sample_index = sample_index[required].copy()
|
| 393 |
+
sample_index["fire_id"] = sample_index["fire_id"].astype(str)
|
| 394 |
+
return sample_index
|
| 395 |
+
|
| 396 |
+
|
| 397 |
+
def split_frames(samples: pd.DataFrame) -> dict[str, pd.DataFrame]:
|
| 398 |
+
return {
|
| 399 |
+
"train": samples.loc[samples["split"] == "train"].copy(),
|
| 400 |
+
"val": samples.loc[samples["split"] == "val"].copy(),
|
| 401 |
+
"test": samples.loc[samples["split"] == "test"].copy(),
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
|
| 405 |
+
def split_years(split: str) -> list[int]:
|
| 406 |
+
if split == "train":
|
| 407 |
+
return [2016, 2017, 2018]
|
| 408 |
+
if split == "val":
|
| 409 |
+
return [2019]
|
| 410 |
+
if split == "test":
|
| 411 |
+
return [2020]
|
| 412 |
+
raise ValueError(split)
|
| 413 |
+
|
| 414 |
+
|
| 415 |
+
def weather_feature_allowed(col: str, weather_days: int) -> bool:
|
| 416 |
+
suffix_windows = {
|
| 417 |
+
"lag1": 2,
|
| 418 |
+
"mean2": 2,
|
| 419 |
+
"sum2": 2,
|
| 420 |
+
"mean3": 3,
|
| 421 |
+
"sum3": 3,
|
| 422 |
+
"mean4": 4,
|
| 423 |
+
"sum4": 4,
|
| 424 |
+
"mean5": 5,
|
| 425 |
+
"sum5": 5,
|
| 426 |
+
}
|
| 427 |
+
if col.endswith("_day0"):
|
| 428 |
+
return True
|
| 429 |
+
for suffix, min_days in suffix_windows.items():
|
| 430 |
+
if col.endswith(f"_{suffix}"):
|
| 431 |
+
return weather_days >= min_days
|
| 432 |
+
return True
|
| 433 |
+
|
| 434 |
+
|
| 435 |
+
def requested_feature_columns(
|
| 436 |
+
feature_manifest: dict,
|
| 437 |
+
input_protocol: str,
|
| 438 |
+
weather_days: int,
|
| 439 |
+
master_columns: Iterable[str],
|
| 440 |
+
target_col: str,
|
| 441 |
+
) -> tuple[list[str], list[str]]:
|
| 442 |
+
forbidden = set(feature_manifest.get("forbidden_as_features", []))
|
| 443 |
+
forbidden.update(
|
| 444 |
+
[
|
| 445 |
+
target_col,
|
| 446 |
+
"fire_size_acres",
|
| 447 |
+
"fire_size_ha",
|
| 448 |
+
"ia_failure_label",
|
| 449 |
+
"contain_dt",
|
| 450 |
+
"containment_hours",
|
| 451 |
+
"log_containment_hours",
|
| 452 |
+
"log_fire_size_ha",
|
| 453 |
+
]
|
| 454 |
+
)
|
| 455 |
+
master_columns = set(master_columns)
|
| 456 |
+
requested = []
|
| 457 |
+
for group in protocol_groups(input_protocol):
|
| 458 |
+
requested.extend(feature_manifest.get(group, []))
|
| 459 |
+
requested = list(dict.fromkeys(requested))
|
| 460 |
+
removed = [col for col in requested if col in forbidden]
|
| 461 |
+
selected = []
|
| 462 |
+
missing = []
|
| 463 |
+
for col in requested:
|
| 464 |
+
if col in forbidden:
|
| 465 |
+
continue
|
| 466 |
+
if col not in master_columns:
|
| 467 |
+
missing.append(col)
|
| 468 |
+
continue
|
| 469 |
+
if col in feature_manifest.get("weather_aggregate", []) or col in feature_manifest.get("fire_danger_aggregate", []):
|
| 470 |
+
if not weather_feature_allowed(col, weather_days):
|
| 471 |
+
removed.append(col)
|
| 472 |
+
continue
|
| 473 |
+
selected.append(col)
|
| 474 |
+
return selected, sorted(set(removed + missing))
|
| 475 |
+
|
| 476 |
+
|
| 477 |
+
def static_protocol_columns(
|
| 478 |
+
feature_manifest: dict,
|
| 479 |
+
input_protocol: str,
|
| 480 |
+
weather_days: int,
|
| 481 |
+
master_columns: Iterable[str],
|
| 482 |
+
target_col: str,
|
| 483 |
+
) -> tuple[list[str], list[str]]:
|
| 484 |
+
if input_protocol == "weather":
|
| 485 |
+
return [], []
|
| 486 |
+
if input_protocol == "all" or input_protocol.startswith("all_without_"):
|
| 487 |
+
groups = [
|
| 488 |
+
group
|
| 489 |
+
for group in protocol_groups(input_protocol)
|
| 490 |
+
if group not in {"weather_aggregate", "fire_danger_aggregate"}
|
| 491 |
+
]
|
| 492 |
+
elif input_protocol == "fire_wide":
|
| 493 |
+
groups = ["fire_strict", "fire_wide"]
|
| 494 |
+
else:
|
| 495 |
+
groups = protocol_groups(input_protocol)
|
| 496 |
+
pseudo_manifest = dict(feature_manifest)
|
| 497 |
+
selected_requested = []
|
| 498 |
+
for group in groups:
|
| 499 |
+
selected_requested.extend(feature_manifest.get(group, []))
|
| 500 |
+
pseudo_manifest["_static"] = selected_requested
|
| 501 |
+
old = PROTOCOL_GROUPS.get("_static")
|
| 502 |
+
PROTOCOL_GROUPS["_static"] = ["_static"]
|
| 503 |
+
try:
|
| 504 |
+
cols, removed = requested_feature_columns(pseudo_manifest, "_static", weather_days, master_columns, target_col)
|
| 505 |
+
finally:
|
| 506 |
+
if old is None:
|
| 507 |
+
PROTOCOL_GROUPS.pop("_static", None)
|
| 508 |
+
else:
|
| 509 |
+
PROTOCOL_GROUPS["_static"] = old
|
| 510 |
+
return cols, removed
|
| 511 |
+
|
| 512 |
+
|
| 513 |
+
def infer_categorical_columns(df: pd.DataFrame, columns: list[str]) -> list[str]:
|
| 514 |
+
categorical = []
|
| 515 |
+
for col in columns:
|
| 516 |
+
if col in KNOWN_CATEGORICAL_COLUMNS:
|
| 517 |
+
categorical.append(col)
|
| 518 |
+
elif (
|
| 519 |
+
pd.api.types.is_object_dtype(df[col])
|
| 520 |
+
or pd.api.types.is_string_dtype(df[col])
|
| 521 |
+
or isinstance(df[col].dtype, pd.CategoricalDtype)
|
| 522 |
+
):
|
| 523 |
+
categorical.append(col)
|
| 524 |
+
return categorical
|
| 525 |
+
|
| 526 |
+
|
| 527 |
+
def fit_transform_event_features(
|
| 528 |
+
train_df: pd.DataFrame,
|
| 529 |
+
val_df: pd.DataFrame,
|
| 530 |
+
test_df: pd.DataFrame,
|
| 531 |
+
feature_cols: list[str],
|
| 532 |
+
standardize: bool,
|
| 533 |
+
) -> tuple[dict[str, np.ndarray], list[str], dict]:
|
| 534 |
+
if not feature_cols:
|
| 535 |
+
arrays = {
|
| 536 |
+
"train": np.zeros((len(train_df), 0), dtype=np.float32),
|
| 537 |
+
"val": np.zeros((len(val_df), 0), dtype=np.float32),
|
| 538 |
+
"test": np.zeros((len(test_df), 0), dtype=np.float32),
|
| 539 |
+
}
|
| 540 |
+
return arrays, [], {
|
| 541 |
+
"categorical_columns": [],
|
| 542 |
+
"numeric_columns": [],
|
| 543 |
+
"imputer_policy": "none",
|
| 544 |
+
"scaler_policy": "none",
|
| 545 |
+
}
|
| 546 |
+
|
| 547 |
+
categorical_cols = infer_categorical_columns(train_df, feature_cols)
|
| 548 |
+
numeric_cols = [col for col in feature_cols if col not in categorical_cols]
|
| 549 |
+
|
| 550 |
+
numeric_train = train_df[numeric_cols].apply(pd.to_numeric, errors="coerce") if numeric_cols else pd.DataFrame(index=train_df.index)
|
| 551 |
+
numeric_val = val_df[numeric_cols].apply(pd.to_numeric, errors="coerce") if numeric_cols else pd.DataFrame(index=val_df.index)
|
| 552 |
+
numeric_test = test_df[numeric_cols].apply(pd.to_numeric, errors="coerce") if numeric_cols else pd.DataFrame(index=test_df.index)
|
| 553 |
+
|
| 554 |
+
medians = numeric_train.median()
|
| 555 |
+
medians = medians.fillna(0.0)
|
| 556 |
+
numeric_train = numeric_train.fillna(medians)
|
| 557 |
+
numeric_val = numeric_val.fillna(medians)
|
| 558 |
+
numeric_test = numeric_test.fillna(medians)
|
| 559 |
+
|
| 560 |
+
scaler_metadata = {"standardize": bool(standardize), "mean": {}, "scale": {}}
|
| 561 |
+
if standardize and numeric_cols:
|
| 562 |
+
scaler = StandardScaler()
|
| 563 |
+
train_numeric_values = scaler.fit_transform(numeric_train.to_numpy(dtype=np.float64))
|
| 564 |
+
val_numeric_values = scaler.transform(numeric_val.to_numpy(dtype=np.float64))
|
| 565 |
+
test_numeric_values = scaler.transform(numeric_test.to_numpy(dtype=np.float64))
|
| 566 |
+
scaler_metadata["mean"] = dict(zip(numeric_cols, scaler.mean_.tolist()))
|
| 567 |
+
scaler_metadata["scale"] = dict(zip(numeric_cols, scaler.scale_.tolist()))
|
| 568 |
+
else:
|
| 569 |
+
train_numeric_values = numeric_train.to_numpy(dtype=np.float64)
|
| 570 |
+
val_numeric_values = numeric_val.to_numpy(dtype=np.float64)
|
| 571 |
+
test_numeric_values = numeric_test.to_numpy(dtype=np.float64)
|
| 572 |
+
|
| 573 |
+
if categorical_cols:
|
| 574 |
+
train_cat = pd.get_dummies(train_df[categorical_cols].fillna("Unknown").astype(str), columns=categorical_cols)
|
| 575 |
+
val_cat = pd.get_dummies(val_df[categorical_cols].fillna("Unknown").astype(str), columns=categorical_cols)
|
| 576 |
+
test_cat = pd.get_dummies(test_df[categorical_cols].fillna("Unknown").astype(str), columns=categorical_cols)
|
| 577 |
+
cat_cols = list(train_cat.columns)
|
| 578 |
+
val_cat = val_cat.reindex(columns=cat_cols, fill_value=0)
|
| 579 |
+
test_cat = test_cat.reindex(columns=cat_cols, fill_value=0)
|
| 580 |
+
train_values = np.concatenate([train_numeric_values, train_cat.to_numpy(dtype=np.float64)], axis=1)
|
| 581 |
+
val_values = np.concatenate([val_numeric_values, val_cat.to_numpy(dtype=np.float64)], axis=1)
|
| 582 |
+
test_values = np.concatenate([test_numeric_values, test_cat.to_numpy(dtype=np.float64)], axis=1)
|
| 583 |
+
else:
|
| 584 |
+
cat_cols = []
|
| 585 |
+
train_values = train_numeric_values
|
| 586 |
+
val_values = val_numeric_values
|
| 587 |
+
test_values = test_numeric_values
|
| 588 |
+
|
| 589 |
+
feature_names = numeric_cols + cat_cols
|
| 590 |
+
arrays = {
|
| 591 |
+
"train": train_values.astype(np.float32),
|
| 592 |
+
"val": val_values.astype(np.float32),
|
| 593 |
+
"test": test_values.astype(np.float32),
|
| 594 |
+
}
|
| 595 |
+
metadata = {
|
| 596 |
+
"categorical_columns": categorical_cols,
|
| 597 |
+
"numeric_columns": numeric_cols,
|
| 598 |
+
"categorical_encoder": "pandas.get_dummies_fit_on_train_align_val_test",
|
| 599 |
+
"categorical_dummy_columns": cat_cols,
|
| 600 |
+
"imputer_policy": "numeric train median, categorical Unknown",
|
| 601 |
+
"numeric_medians": medians.to_dict(),
|
| 602 |
+
"scaler_policy": "StandardScaler fit on train numeric columns" if standardize and numeric_cols else "not_standardized",
|
| 603 |
+
"scaler": scaler_metadata,
|
| 604 |
+
}
|
| 605 |
+
return arrays, feature_names, metadata
|
| 606 |
+
|
| 607 |
+
|
| 608 |
+
def write_sample_index_outputs(
|
| 609 |
+
out_dir: Path,
|
| 610 |
+
split: str,
|
| 611 |
+
n_rows: int,
|
| 612 |
+
y: np.ndarray,
|
| 613 |
+
sample_index: pd.DataFrame,
|
| 614 |
+
task: str,
|
| 615 |
+
) -> None:
|
| 616 |
+
target_col = target_info(task)["target_column"]
|
| 617 |
+
raw_col = target_info(task)["raw_column"]
|
| 618 |
+
expected_cols = ["fire_id", "year", "split", target_col]
|
| 619 |
+
if raw_col:
|
| 620 |
+
expected_cols.append(raw_col)
|
| 621 |
+
missing = [col for col in expected_cols if col not in sample_index.columns]
|
| 622 |
+
if missing:
|
| 623 |
+
raise KeyError(f"sample_index for {split} missing columns: {missing}")
|
| 624 |
+
if n_rows != len(y):
|
| 625 |
+
raise ValueError(f"{split}: n_rows={n_rows} does not match len(y)={len(y)}")
|
| 626 |
+
if n_rows != len(sample_index):
|
| 627 |
+
raise ValueError(f"{split}: n_rows={n_rows} does not match len(sample_index)={len(sample_index)}")
|
| 628 |
+
target_values = sample_index[target_col].to_numpy()
|
| 629 |
+
if not np.allclose(y.astype(float), target_values.astype(float), equal_nan=True):
|
| 630 |
+
raise ValueError(f"{split}: y array order/values do not match sample_index {target_col}")
|
| 631 |
+
fire_ids = sample_index["fire_id"].astype(str).to_numpy()
|
| 632 |
+
if len(fire_ids) != n_rows:
|
| 633 |
+
raise ValueError(f"{split}: fire_id order length does not match row count")
|
| 634 |
+
|
| 635 |
+
np.save(out_dir / f"y_{split}.npy", y)
|
| 636 |
+
np.save(out_dir / f"fire_id_{split}.npy", fire_ids)
|
| 637 |
+
saved_fire_ids = np.load(out_dir / f"fire_id_{split}.npy", allow_pickle=True).astype(str)
|
| 638 |
+
if not np.array_equal(saved_fire_ids, fire_ids):
|
| 639 |
+
raise ValueError(f"{split}: saved fire_id array does not match sample_index order")
|
| 640 |
+
if raw_col:
|
| 641 |
+
np.save(out_dir / f"{raw_col}_{split}.npy", sample_index[raw_col].to_numpy(dtype=np.float32))
|
| 642 |
+
sample_index[expected_cols].to_parquet(out_dir / f"sample_index_{split}.parquet", index=False)
|
| 643 |
+
|
| 644 |
+
|
| 645 |
+
def write_split_outputs(
|
| 646 |
+
out_dir: Path,
|
| 647 |
+
split: str,
|
| 648 |
+
X: np.ndarray,
|
| 649 |
+
y: np.ndarray,
|
| 650 |
+
sample_index: pd.DataFrame,
|
| 651 |
+
task: str,
|
| 652 |
+
) -> None:
|
| 653 |
+
write_sample_index_outputs(out_dir, split, len(X), y, sample_index, task)
|
| 654 |
+
np.save(out_dir / f"X_{split}.npy", X)
|
| 655 |
+
|
| 656 |
+
|
| 657 |
+
def write_seq_split_outputs(
|
| 658 |
+
out_dir: Path,
|
| 659 |
+
split: str,
|
| 660 |
+
X_seq: np.ndarray,
|
| 661 |
+
X_static: np.ndarray,
|
| 662 |
+
y: np.ndarray,
|
| 663 |
+
sample_index: pd.DataFrame,
|
| 664 |
+
task: str,
|
| 665 |
+
) -> None:
|
| 666 |
+
if len(X_seq) != len(y):
|
| 667 |
+
raise ValueError(f"{split}: len(X_seq)={len(X_seq)} does not match len(y)={len(y)}")
|
| 668 |
+
if len(X_static) != len(y):
|
| 669 |
+
raise ValueError(f"{split}: len(X_static)={len(X_static)} does not match len(y)={len(y)}")
|
| 670 |
+
write_sample_index_outputs(out_dir, split, len(X_seq), y, sample_index, task)
|
| 671 |
+
np.save(out_dir / f"X_seq_{split}.npy", X_seq)
|
| 672 |
+
np.save(out_dir / f"X_static_{split}.npy", X_static)
|
| 673 |
+
|
| 674 |
+
|
| 675 |
+
def save_metadata(out_dir: Path, metadata: dict) -> None:
|
| 676 |
+
write_json(out_dir / "metadata.json", metadata)
|
| 677 |
+
|
| 678 |
+
|
| 679 |
+
def build_tabular_cache(args, paths: dict[str, Path], feature_manifest: dict) -> Path:
|
| 680 |
+
out_dir = output_subdir(args.output_dir, args.task, "tabular", args.weather_days, args.input_protocol)
|
| 681 |
+
if (out_dir / "X_train.npy").exists() and not args.overwrite:
|
| 682 |
+
print(f"Reusing existing tabular cache: {out_dir}")
|
| 683 |
+
return out_dir
|
| 684 |
+
remove_output_dir(out_dir, args.overwrite)
|
| 685 |
+
|
| 686 |
+
master = normalize_master_metadata(read_parquet_robust(paths["master"]))
|
| 687 |
+
samples = apply_input_protocol_sample_filter(filter_task_samples(master, args.task), args.input_protocol)
|
| 688 |
+
splits = split_frames(samples)
|
| 689 |
+
sample_index_splits = split_frames(build_sample_index(samples, master, args.task))
|
| 690 |
+
target_col = target_info(args.task)["target_column"]
|
| 691 |
+
feature_cols, removed = requested_feature_columns(
|
| 692 |
+
feature_manifest, args.input_protocol, args.weather_days, master.columns, target_col
|
| 693 |
+
)
|
| 694 |
+
arrays, feature_names, preprocessing = fit_transform_event_features(
|
| 695 |
+
splits["train"], splits["val"], splits["test"], feature_cols, args.standardize
|
| 696 |
+
)
|
| 697 |
+
for split, frame in splits.items():
|
| 698 |
+
y = frame["target"].to_numpy(dtype=np.float32)
|
| 699 |
+
write_split_outputs(out_dir, split, arrays[split], y, sample_index_splits[split], args.task)
|
| 700 |
+
write_json(out_dir / "feature_names.json", {"feature_names": feature_names})
|
| 701 |
+
save_metadata(
|
| 702 |
+
out_dir,
|
| 703 |
+
{
|
| 704 |
+
"task": args.task,
|
| 705 |
+
"representation": "tabular",
|
| 706 |
+
"input_protocol": args.input_protocol,
|
| 707 |
+
"weather_days": args.weather_days,
|
| 708 |
+
"feature_names": feature_names,
|
| 709 |
+
"source_feature_columns": feature_cols,
|
| 710 |
+
"target_column": target_col,
|
| 711 |
+
"split_counts": {split: int(len(frame)) for split, frame in splits.items()},
|
| 712 |
+
"forbidden_columns_removed": removed,
|
| 713 |
+
"missing_value_policy": preprocessing["imputer_policy"],
|
| 714 |
+
"imputer_policy": preprocessing["imputer_policy"],
|
| 715 |
+
"scaler_policy": preprocessing["scaler_policy"],
|
| 716 |
+
"preprocessing": preprocessing,
|
| 717 |
+
"created_at": created_at(),
|
| 718 |
+
},
|
| 719 |
+
)
|
| 720 |
+
print(f"Wrote tabular cache: {out_dir}")
|
| 721 |
+
return out_dir
|
| 722 |
+
|
| 723 |
+
|
| 724 |
+
def train_weather_medians(weather_daily: pd.DataFrame, train_fire_ids: np.ndarray, rel_days: list[int], channels: list[str]) -> pd.Series:
|
| 725 |
+
train_weather = weather_daily.loc[
|
| 726 |
+
weather_daily["fire_id"].astype(str).isin(set(train_fire_ids.astype(str)))
|
| 727 |
+
& weather_daily["relative_day"].isin(rel_days)
|
| 728 |
+
]
|
| 729 |
+
medians = train_weather[channels].apply(pd.to_numeric, errors="coerce").median()
|
| 730 |
+
return medians.fillna(0.0)
|
| 731 |
+
|
| 732 |
+
|
| 733 |
+
def build_sequence_array(
|
| 734 |
+
weather_daily: pd.DataFrame,
|
| 735 |
+
sample_df: pd.DataFrame,
|
| 736 |
+
rel_days: list[int],
|
| 737 |
+
channels: list[str],
|
| 738 |
+
medians: pd.Series,
|
| 739 |
+
scaler: StandardScaler | None,
|
| 740 |
+
) -> np.ndarray:
|
| 741 |
+
n = len(sample_df)
|
| 742 |
+
t = len(rel_days)
|
| 743 |
+
if not channels:
|
| 744 |
+
return np.zeros((n, t, 0), dtype=np.float32)
|
| 745 |
+
fire_order = sample_df[["fire_id"]].copy()
|
| 746 |
+
fire_order["fire_order"] = np.arange(n)
|
| 747 |
+
base = pd.MultiIndex.from_product(
|
| 748 |
+
[sample_df["fire_id"].astype(str).to_list(), rel_days],
|
| 749 |
+
names=["fire_id", "relative_day"],
|
| 750 |
+
).to_frame(index=False)
|
| 751 |
+
base = base.merge(fire_order, on="fire_id", how="left")
|
| 752 |
+
weather = weather_daily[["fire_id", "relative_day"] + channels].copy()
|
| 753 |
+
weather["fire_id"] = weather["fire_id"].astype(str)
|
| 754 |
+
merged = base.merge(weather, on=["fire_id", "relative_day"], how="left")
|
| 755 |
+
values = merged[channels].apply(pd.to_numeric, errors="coerce").fillna(medians).to_numpy(dtype=np.float64)
|
| 756 |
+
if scaler is not None and channels:
|
| 757 |
+
values = scaler.transform(values)
|
| 758 |
+
merged_values = values.reshape(n, t, len(channels))
|
| 759 |
+
return merged_values.astype(np.float32)
|
| 760 |
+
|
| 761 |
+
|
| 762 |
+
def build_temporal_cache(args, paths: dict[str, Path], feature_manifest: dict) -> Path:
|
| 763 |
+
out_dir = output_subdir(args.output_dir, args.task, "temporal", args.weather_days, args.input_protocol)
|
| 764 |
+
if (out_dir / "X_seq_train.npy").exists() and not args.overwrite:
|
| 765 |
+
print(f"Reusing existing temporal cache: {out_dir}")
|
| 766 |
+
return out_dir
|
| 767 |
+
remove_output_dir(out_dir, args.overwrite)
|
| 768 |
+
|
| 769 |
+
master = normalize_master_metadata(read_parquet_robust(paths["master"]))
|
| 770 |
+
weather_daily = read_parquet_robust(paths["weather_daily_event"])
|
| 771 |
+
samples = apply_input_protocol_sample_filter(filter_task_samples(master, args.task), args.input_protocol)
|
| 772 |
+
splits = split_frames(samples)
|
| 773 |
+
sample_index_splits = split_frames(build_sample_index(samples, master, args.task))
|
| 774 |
+
rel_days = WEATHER_DAY_MAP[args.weather_days]
|
| 775 |
+
target_col = target_info(args.task)["target_column"]
|
| 776 |
+
|
| 777 |
+
seq_channels = TEMPORAL_WEATHER_CHANNELS if protocol_includes_weather(args.input_protocol) else []
|
| 778 |
+
seq_channels = [col for col in seq_channels if col in weather_daily.columns]
|
| 779 |
+
medians = train_weather_medians(weather_daily, splits["train"]["fire_id"].astype(str).to_numpy(), rel_days, seq_channels) if seq_channels else pd.Series(dtype=float)
|
| 780 |
+
seq_scaler = None
|
| 781 |
+
if args.standardize and seq_channels:
|
| 782 |
+
train_long = weather_daily.loc[
|
| 783 |
+
weather_daily["fire_id"].astype(str).isin(set(splits["train"]["fire_id"].astype(str)))
|
| 784 |
+
& weather_daily["relative_day"].isin(rel_days),
|
| 785 |
+
seq_channels,
|
| 786 |
+
].apply(pd.to_numeric, errors="coerce").fillna(medians)
|
| 787 |
+
seq_scaler = StandardScaler().fit(train_long.to_numpy(dtype=np.float64))
|
| 788 |
+
|
| 789 |
+
static_cols, removed = static_protocol_columns(
|
| 790 |
+
feature_manifest, args.input_protocol, args.weather_days, master.columns, target_col
|
| 791 |
+
)
|
| 792 |
+
static_arrays, static_feature_names, static_preprocessing = fit_transform_event_features(
|
| 793 |
+
splits["train"], splits["val"], splits["test"], static_cols, args.standardize
|
| 794 |
+
)
|
| 795 |
+
|
| 796 |
+
for split, frame in splits.items():
|
| 797 |
+
X_seq = build_sequence_array(weather_daily, frame, rel_days, seq_channels, medians, seq_scaler)
|
| 798 |
+
X_static = static_arrays[split]
|
| 799 |
+
y = frame["target"].to_numpy(dtype=np.float32)
|
| 800 |
+
write_seq_split_outputs(out_dir, split, X_seq, X_static, y, sample_index_splits[split], args.task)
|
| 801 |
+
write_json(out_dir / "temporal_feature_names.json", {"feature_names": seq_channels})
|
| 802 |
+
write_json(out_dir / "static_feature_names.json", {"feature_names": static_feature_names})
|
| 803 |
+
save_metadata(
|
| 804 |
+
out_dir,
|
| 805 |
+
{
|
| 806 |
+
"task": args.task,
|
| 807 |
+
"representation": "temporal",
|
| 808 |
+
"input_protocol": args.input_protocol,
|
| 809 |
+
"weather_days": args.weather_days,
|
| 810 |
+
"relative_days": rel_days,
|
| 811 |
+
"temporal_feature_names": seq_channels,
|
| 812 |
+
"static_feature_names": static_feature_names,
|
| 813 |
+
"target_column": target_col,
|
| 814 |
+
"split_counts": {split: int(len(frame)) for split, frame in splits.items()},
|
| 815 |
+
"forbidden_columns_removed": removed,
|
| 816 |
+
"missing_value_policy": "weather numeric train median; static uses tabular policy",
|
| 817 |
+
"scaler_policy": "StandardScaler fit on train only" if args.standardize else "not_standardized",
|
| 818 |
+
"static_preprocessing": static_preprocessing,
|
| 819 |
+
"created_at": created_at(),
|
| 820 |
+
},
|
| 821 |
+
)
|
| 822 |
+
print(f"Wrote temporal cache: {out_dir}")
|
| 823 |
+
return out_dir
|
| 824 |
+
|
| 825 |
+
|
| 826 |
+
def parquet_files_under(path: Path) -> list[Path]:
|
| 827 |
+
if path.is_file():
|
| 828 |
+
return [path]
|
| 829 |
+
return sorted(p for p in path.rglob("*.parquet") if p.is_file())
|
| 830 |
+
|
| 831 |
+
|
| 832 |
+
def _file_parquet_columns(path: Path) -> set[str]:
|
| 833 |
+
try:
|
| 834 |
+
import pyarrow.parquet as pq
|
| 835 |
+
|
| 836 |
+
return set(pq.ParquetFile(path).schema.names)
|
| 837 |
+
except Exception:
|
| 838 |
+
return set(pd.read_parquet(path).columns)
|
| 839 |
+
|
| 840 |
+
|
| 841 |
+
def _read_parquet_file_existing_columns(path: Path, columns: list[str] | None = None) -> pd.DataFrame:
|
| 842 |
+
if columns is None:
|
| 843 |
+
return pd.read_parquet(path)
|
| 844 |
+
available = _file_parquet_columns(path)
|
| 845 |
+
keep = [col for col in columns if col in available]
|
| 846 |
+
if not keep:
|
| 847 |
+
return pd.DataFrame(index=range(0))
|
| 848 |
+
return pd.read_parquet(path, columns=keep)
|
| 849 |
+
|
| 850 |
+
|
| 851 |
+
def read_parquet_robust(path: Path, columns: list[str] | None = None) -> pd.DataFrame:
|
| 852 |
+
"""Read parquet files without asking pyarrow to merge hive partitions."""
|
| 853 |
+
path = Path(path)
|
| 854 |
+
if path.is_file():
|
| 855 |
+
return _read_parquet_file_existing_columns(path, columns=columns)
|
| 856 |
+
files = parquet_files_under(path)
|
| 857 |
+
if not files:
|
| 858 |
+
return pd.DataFrame()
|
| 859 |
+
frames = [_read_parquet_file_existing_columns(part, columns=columns) for part in files]
|
| 860 |
+
return pd.concat(frames, ignore_index=True)
|
| 861 |
+
|
| 862 |
+
|
| 863 |
+
def read_parquet_parts_sample(path: Path, columns: list[str] | None = None, max_parts: int = 2) -> pd.DataFrame:
|
| 864 |
+
"""Read a few physical parquet part files for cheap validation."""
|
| 865 |
+
path = Path(path)
|
| 866 |
+
files = parquet_files_under(path)[:max_parts]
|
| 867 |
+
if not files:
|
| 868 |
+
return pd.DataFrame()
|
| 869 |
+
frames = [_read_parquet_file_existing_columns(part, columns=columns) for part in files]
|
| 870 |
+
return pd.concat(frames, ignore_index=True)
|
| 871 |
+
|
| 872 |
+
|
| 873 |
+
def read_parquet_files(files: list[Path], columns: list[str] | None = None) -> pd.DataFrame:
|
| 874 |
+
if not files:
|
| 875 |
+
return pd.DataFrame()
|
| 876 |
+
return pd.concat([_read_parquet_file_existing_columns(file, columns=columns) for file in files], ignore_index=True)
|
| 877 |
+
|
| 878 |
+
|
| 879 |
+
def read_patch_table(path: Path, years: list[int], columns: list[str] | None = None, relative_days: list[int] | None = None) -> pd.DataFrame:
|
| 880 |
+
files = []
|
| 881 |
+
if path.is_file():
|
| 882 |
+
frame = read_parquet_robust(path, columns=columns)
|
| 883 |
+
if "year" in frame.columns:
|
| 884 |
+
frame = frame.loc[frame["year"].isin(years)]
|
| 885 |
+
if relative_days is not None and "relative_day" in frame.columns:
|
| 886 |
+
frame = frame.loc[frame["relative_day"].isin(relative_days)]
|
| 887 |
+
return frame
|
| 888 |
+
for year in years:
|
| 889 |
+
year_dir = path / f"year={year}"
|
| 890 |
+
if not year_dir.exists():
|
| 891 |
+
continue
|
| 892 |
+
if relative_days is None:
|
| 893 |
+
files.extend(parquet_files_under(year_dir))
|
| 894 |
+
else:
|
| 895 |
+
for rel in relative_days:
|
| 896 |
+
rel_dir = year_dir / f"relative_day={rel}"
|
| 897 |
+
files.extend(parquet_files_under(rel_dir))
|
| 898 |
+
return read_parquet_files(files, columns=columns)
|
| 899 |
+
|
| 900 |
+
|
| 901 |
+
def protocol_patch_sources(input_protocol: str, weather_days: int) -> dict[str, list[str]]:
|
| 902 |
+
sources = {"metadata": [], "static": [], "viirs": [], "weather": [], "osm": []}
|
| 903 |
+
if input_protocol.startswith("metadata_"):
|
| 904 |
+
sources["metadata"] = PATCH_METADATA_CHANNELS
|
| 905 |
+
input_protocol = input_protocol.replace("metadata_", "", 1)
|
| 906 |
+
if input_protocol in {"firms", "fire"}:
|
| 907 |
+
sources["viirs"] = VIIRS_PATCH_CHANNELS
|
| 908 |
+
elif input_protocol == "fire_wide":
|
| 909 |
+
sources["viirs"] = VIIRS_PATCH_CHANNELS
|
| 910 |
+
elif input_protocol == "weather":
|
| 911 |
+
sources["weather"] = None
|
| 912 |
+
elif input_protocol == "fuel":
|
| 913 |
+
sources["static"] = FUEL_PATCH_CHANNELS
|
| 914 |
+
elif input_protocol == "vegetation":
|
| 915 |
+
sources["static"] = VEGETATION_PATCH_CHANNELS
|
| 916 |
+
elif input_protocol == "topography":
|
| 917 |
+
sources["static"] = TOPO_PATCH_CHANNELS
|
| 918 |
+
elif input_protocol == "access":
|
| 919 |
+
sources["osm"] = OSM_PATCH_CHANNELS
|
| 920 |
+
elif input_protocol == "human":
|
| 921 |
+
sources["static"] = ["pop_density"]
|
| 922 |
+
elif input_protocol == "all":
|
| 923 |
+
sources["static"] = STATIC_PATCH_CHANNELS
|
| 924 |
+
sources["viirs"] = VIIRS_PATCH_CHANNELS
|
| 925 |
+
sources["weather"] = None
|
| 926 |
+
sources["osm"] = OSM_PATCH_CHANNELS
|
| 927 |
+
elif input_protocol.startswith("all_without_"):
|
| 928 |
+
removed = input_protocol.replace("all_without_", "", 1)
|
| 929 |
+
static_channels = list(STATIC_PATCH_CHANNELS)
|
| 930 |
+
if removed == "fire":
|
| 931 |
+
sources["static"] = static_channels
|
| 932 |
+
sources["weather"] = None
|
| 933 |
+
sources["osm"] = OSM_PATCH_CHANNELS
|
| 934 |
+
elif removed == "weather":
|
| 935 |
+
sources["static"] = static_channels
|
| 936 |
+
sources["viirs"] = VIIRS_PATCH_CHANNELS
|
| 937 |
+
sources["osm"] = OSM_PATCH_CHANNELS
|
| 938 |
+
elif removed == "vegetation":
|
| 939 |
+
sources["static"] = [ch for ch in static_channels if ch not in VEGETATION_PATCH_CHANNELS]
|
| 940 |
+
sources["viirs"] = VIIRS_PATCH_CHANNELS
|
| 941 |
+
sources["weather"] = None
|
| 942 |
+
sources["osm"] = OSM_PATCH_CHANNELS
|
| 943 |
+
elif removed == "fuel":
|
| 944 |
+
sources["static"] = [ch for ch in static_channels if ch not in FUEL_PATCH_CHANNELS]
|
| 945 |
+
sources["viirs"] = VIIRS_PATCH_CHANNELS
|
| 946 |
+
sources["weather"] = None
|
| 947 |
+
sources["osm"] = OSM_PATCH_CHANNELS
|
| 948 |
+
elif removed == "topography":
|
| 949 |
+
sources["static"] = [ch for ch in static_channels if ch not in TOPO_PATCH_CHANNELS]
|
| 950 |
+
sources["viirs"] = VIIRS_PATCH_CHANNELS
|
| 951 |
+
sources["weather"] = None
|
| 952 |
+
sources["osm"] = OSM_PATCH_CHANNELS
|
| 953 |
+
elif removed == "access":
|
| 954 |
+
sources["static"] = static_channels
|
| 955 |
+
sources["viirs"] = VIIRS_PATCH_CHANNELS
|
| 956 |
+
sources["weather"] = None
|
| 957 |
+
elif removed == "human":
|
| 958 |
+
sources["static"] = [ch for ch in static_channels if ch != "pop_density"]
|
| 959 |
+
sources["viirs"] = VIIRS_PATCH_CHANNELS
|
| 960 |
+
sources["weather"] = None
|
| 961 |
+
sources["osm"] = OSM_PATCH_CHANNELS
|
| 962 |
+
else:
|
| 963 |
+
raise KeyError(input_protocol)
|
| 964 |
+
elif input_protocol == "metadata":
|
| 965 |
+
sources["metadata"] = PATCH_METADATA_CHANNELS
|
| 966 |
+
else:
|
| 967 |
+
raise KeyError(input_protocol)
|
| 968 |
+
return sources
|
| 969 |
+
|
| 970 |
+
|
| 971 |
+
def weather_aggregate_patch_channels(path: Path, years: list[int], weather_days: int) -> list[str]:
|
| 972 |
+
sample = read_patch_table(path, years[:1], columns=None)
|
| 973 |
+
if sample.empty:
|
| 974 |
+
return []
|
| 975 |
+
key_cols = {"fire_id", "year", "split", "row", "col", "cell_id"}
|
| 976 |
+
channels = [col for col in sample.columns if col not in key_cols and weather_feature_allowed(col, weather_days)]
|
| 977 |
+
return channels
|
| 978 |
+
|
| 979 |
+
|
| 980 |
+
def read_joined_spatial_patch(
|
| 981 |
+
paths: dict[str, Path],
|
| 982 |
+
sample_df: pd.DataFrame,
|
| 983 |
+
input_protocol: str,
|
| 984 |
+
weather_days: int,
|
| 985 |
+
include_weather_daily: bool = False,
|
| 986 |
+
relative_days: list[int] | None = None,
|
| 987 |
+
) -> tuple[pd.DataFrame, list[str]]:
|
| 988 |
+
years = sorted(sample_df["year"].unique().tolist())
|
| 989 |
+
fire_ids = set(sample_df["fire_id"].astype(str))
|
| 990 |
+
patch_key_cols = ["fire_id", "row", "col", "cell_id"]
|
| 991 |
+
base_cols = patch_key_cols
|
| 992 |
+
base = read_patch_table(paths["grid_index"], years, columns=base_cols)
|
| 993 |
+
if base.empty:
|
| 994 |
+
raise ValueError("Grid index patch table is empty or missing for requested years.")
|
| 995 |
+
base["fire_id"] = base["fire_id"].astype(str)
|
| 996 |
+
base = base.loc[base["fire_id"].isin(fire_ids)].copy()
|
| 997 |
+
|
| 998 |
+
channel_names = []
|
| 999 |
+
sources = protocol_patch_sources(input_protocol, weather_days)
|
| 1000 |
+
|
| 1001 |
+
if sources["metadata"]:
|
| 1002 |
+
present = [c for c in sources["metadata"] if c in sample_df.columns]
|
| 1003 |
+
if present:
|
| 1004 |
+
metadata = sample_df[["fire_id"] + present].copy()
|
| 1005 |
+
metadata["fire_id"] = metadata["fire_id"].astype(str)
|
| 1006 |
+
base = base.merge(metadata, on="fire_id", how="left")
|
| 1007 |
+
channel_names.extend(present)
|
| 1008 |
+
|
| 1009 |
+
if sources["static"]:
|
| 1010 |
+
cols = patch_key_cols + sources["static"]
|
| 1011 |
+
static = read_patch_table(paths["static_patch"], years, columns=cols)
|
| 1012 |
+
static["fire_id"] = static["fire_id"].astype(str)
|
| 1013 |
+
keep_cols = [c for c in cols if c in static.columns]
|
| 1014 |
+
static = static.loc[static["fire_id"].isin(fire_ids), keep_cols]
|
| 1015 |
+
present = [c for c in sources["static"] if c in static.columns]
|
| 1016 |
+
base = base.merge(static[["fire_id", "row", "col", "cell_id"] + present], on=["fire_id", "row", "col", "cell_id"], how="left")
|
| 1017 |
+
channel_names.extend(present)
|
| 1018 |
+
|
| 1019 |
+
if sources["viirs"]:
|
| 1020 |
+
viirs = read_patch_table(paths["viirs_patch"], years, columns=patch_key_cols + sources["viirs"])
|
| 1021 |
+
viirs["fire_id"] = viirs["fire_id"].astype(str)
|
| 1022 |
+
present = [c for c in sources["viirs"] if c in viirs.columns]
|
| 1023 |
+
viirs = viirs.loc[viirs["fire_id"].isin(fire_ids), ["fire_id", "row", "col", "cell_id"] + present]
|
| 1024 |
+
base = base.merge(viirs, on=["fire_id", "row", "col", "cell_id"], how="left")
|
| 1025 |
+
channel_names.extend(present)
|
| 1026 |
+
|
| 1027 |
+
if sources["weather"] is None and protocol_includes_weather(input_protocol) and not include_weather_daily:
|
| 1028 |
+
weather_channels = weather_aggregate_patch_channels(paths["weather_aggregate_patch"], years, weather_days)
|
| 1029 |
+
weather = read_patch_table(paths["weather_aggregate_patch"], years, columns=patch_key_cols + weather_channels)
|
| 1030 |
+
weather["fire_id"] = weather["fire_id"].astype(str)
|
| 1031 |
+
weather = weather.loc[weather["fire_id"].isin(fire_ids), ["fire_id", "row", "col", "cell_id"] + weather_channels]
|
| 1032 |
+
base = base.merge(weather, on=["fire_id", "row", "col", "cell_id"], how="left")
|
| 1033 |
+
channel_names.extend(weather_channels)
|
| 1034 |
+
|
| 1035 |
+
if sources["osm"]:
|
| 1036 |
+
osm = read_patch_table(paths["osm_patch"], years, columns=patch_key_cols + sources["osm"])
|
| 1037 |
+
osm["fire_id"] = osm["fire_id"].astype(str)
|
| 1038 |
+
present = [c for c in sources["osm"] if c in osm.columns]
|
| 1039 |
+
osm = osm.loc[osm["fire_id"].isin(fire_ids), ["fire_id", "row", "col", "cell_id"] + present]
|
| 1040 |
+
base = base.merge(osm, on=["fire_id", "row", "col", "cell_id"], how="left")
|
| 1041 |
+
channel_names.extend(present)
|
| 1042 |
+
|
| 1043 |
+
return base, list(dict.fromkeys(channel_names))
|
| 1044 |
+
|
| 1045 |
+
|
| 1046 |
+
def patch_to_array(patch: pd.DataFrame, sample_df: pd.DataFrame, channels: list[str]) -> np.ndarray:
|
| 1047 |
+
n = len(sample_df)
|
| 1048 |
+
c = len(channels)
|
| 1049 |
+
if c == 0:
|
| 1050 |
+
return np.zeros((n, 0, PATCH_SIZE, PATCH_SIZE), dtype=np.float32)
|
| 1051 |
+
order = pd.DataFrame({"fire_id": sample_df["fire_id"].astype(str), "fire_order": np.arange(n)})
|
| 1052 |
+
patch = patch.copy()
|
| 1053 |
+
patch["fire_id"] = patch["fire_id"].astype(str)
|
| 1054 |
+
patch = patch.merge(order, on="fire_id", how="inner")
|
| 1055 |
+
patch = patch.sort_values(["fire_order", "row", "col"])
|
| 1056 |
+
expected = n * CELLS_PER_PATCH
|
| 1057 |
+
if len(patch) != expected:
|
| 1058 |
+
raise ValueError(f"Patch cannot reshape: got {len(patch)} rows, expected {expected}.")
|
| 1059 |
+
values = patch[channels].apply(pd.to_numeric, errors="coerce").fillna(0.0).to_numpy(dtype=np.float32)
|
| 1060 |
+
return values.reshape(n, PATCH_SIZE, PATCH_SIZE, c).transpose(0, 3, 1, 2)
|
| 1061 |
+
|
| 1062 |
+
|
| 1063 |
+
def standardizable_patch_indices(channels: list[str]) -> list[int]:
|
| 1064 |
+
skip_exact = {
|
| 1065 |
+
"fbfm40",
|
| 1066 |
+
"fd",
|
| 1067 |
+
"fvt",
|
| 1068 |
+
"fvc",
|
| 1069 |
+
"fvh",
|
| 1070 |
+
"evt",
|
| 1071 |
+
"evc",
|
| 1072 |
+
"evh",
|
| 1073 |
+
"viirs_cell_has_detection_D",
|
| 1074 |
+
"cell_has_drivable_road",
|
| 1075 |
+
}
|
| 1076 |
+
return [idx for idx, ch in enumerate(channels) if ch not in skip_exact and not ch.endswith("_missing_mask")]
|
| 1077 |
+
|
| 1078 |
+
|
| 1079 |
+
def fit_patch_stats_train(X_train: np.ndarray, channels: list[str], spatiotemporal: bool = False) -> dict:
|
| 1080 |
+
indices = standardizable_patch_indices(channels)
|
| 1081 |
+
if not indices:
|
| 1082 |
+
return {"indices": [], "mean": [], "std": []}
|
| 1083 |
+
if spatiotemporal:
|
| 1084 |
+
mean = X_train[:, :, indices, :, :].mean(axis=(0, 1, 3, 4))
|
| 1085 |
+
std = X_train[:, :, indices, :, :].std(axis=(0, 1, 3, 4))
|
| 1086 |
+
else:
|
| 1087 |
+
mean = X_train[:, indices, :, :].mean(axis=(0, 2, 3))
|
| 1088 |
+
std = X_train[:, indices, :, :].std(axis=(0, 2, 3))
|
| 1089 |
+
std = np.where(std == 0, 1.0, std)
|
| 1090 |
+
return {"indices": indices, "mean": mean.tolist(), "std": std.tolist()}
|
| 1091 |
+
|
| 1092 |
+
|
| 1093 |
+
def apply_patch_standardization(X: np.ndarray, stats: dict, spatiotemporal: bool = False) -> np.ndarray:
|
| 1094 |
+
indices = stats["indices"]
|
| 1095 |
+
if not indices:
|
| 1096 |
+
return X
|
| 1097 |
+
mean = np.array(stats["mean"], dtype=np.float32)
|
| 1098 |
+
std = np.array(stats["std"], dtype=np.float32)
|
| 1099 |
+
X = X.copy()
|
| 1100 |
+
if spatiotemporal:
|
| 1101 |
+
X[:, :, indices, :, :] = (X[:, :, indices, :, :] - mean.reshape(1, 1, -1, 1, 1)) / std.reshape(1, 1, -1, 1, 1)
|
| 1102 |
+
else:
|
| 1103 |
+
X[:, indices, :, :] = (X[:, indices, :, :] - mean.reshape(1, -1, 1, 1)) / std.reshape(1, -1, 1, 1)
|
| 1104 |
+
return X
|
| 1105 |
+
|
| 1106 |
+
|
| 1107 |
+
def build_spatial_cache(args, paths: dict[str, Path]) -> Path:
|
| 1108 |
+
out_dir = output_subdir(args.output_dir, args.task, "spatial", args.weather_days, args.input_protocol)
|
| 1109 |
+
if (out_dir / "X_train.npy").exists() and not args.overwrite:
|
| 1110 |
+
print(f"Reusing existing spatial cache: {out_dir}")
|
| 1111 |
+
return out_dir
|
| 1112 |
+
remove_output_dir(out_dir, args.overwrite)
|
| 1113 |
+
|
| 1114 |
+
master = normalize_master_metadata(read_parquet_robust(paths["master"]))
|
| 1115 |
+
samples = apply_input_protocol_sample_filter(filter_task_samples(master, args.task), args.input_protocol)
|
| 1116 |
+
splits = split_frames(samples)
|
| 1117 |
+
sample_index_splits = split_frames(build_sample_index(samples, master, args.task))
|
| 1118 |
+
|
| 1119 |
+
split_arrays = {}
|
| 1120 |
+
channel_names = None
|
| 1121 |
+
for split, frame in splits.items():
|
| 1122 |
+
patch, channels = read_joined_spatial_patch(paths, frame, args.input_protocol, args.weather_days)
|
| 1123 |
+
if channel_names is None:
|
| 1124 |
+
channel_names = channels
|
| 1125 |
+
X = patch_to_array(patch, frame, channel_names)
|
| 1126 |
+
split_arrays[split] = X
|
| 1127 |
+
|
| 1128 |
+
patch_stats = {"indices": [], "mean": [], "std": []}
|
| 1129 |
+
if args.standardize and channel_names:
|
| 1130 |
+
patch_stats = fit_patch_stats_train(split_arrays["train"], channel_names, spatiotemporal=False)
|
| 1131 |
+
for split in split_arrays:
|
| 1132 |
+
split_arrays[split] = apply_patch_standardization(split_arrays[split], patch_stats, spatiotemporal=False)
|
| 1133 |
+
|
| 1134 |
+
for split, frame in splits.items():
|
| 1135 |
+
y = frame["target"].to_numpy(dtype=np.float32)
|
| 1136 |
+
write_split_outputs(out_dir, split, split_arrays[split], y, sample_index_splits[split], args.task)
|
| 1137 |
+
write_json(out_dir / "channel_names.json", {"channel_names": channel_names or []})
|
| 1138 |
+
save_metadata(
|
| 1139 |
+
out_dir,
|
| 1140 |
+
{
|
| 1141 |
+
"task": args.task,
|
| 1142 |
+
"representation": "spatial",
|
| 1143 |
+
"input_protocol": args.input_protocol,
|
| 1144 |
+
"weather_days": args.weather_days,
|
| 1145 |
+
"target_column": target_info(args.task)["target_column"],
|
| 1146 |
+
"channel_names": channel_names or [],
|
| 1147 |
+
"split_counts": {split: int(len(frame)) for split, frame in splits.items()},
|
| 1148 |
+
"missing_value_policy": "patch NaN filled with 0; no mask channels in v1",
|
| 1149 |
+
"scaler_policy": "channel-wise train mean/std for non-categorical non-binary patch channels" if args.standardize else "not_standardized",
|
| 1150 |
+
"channel_stats": patch_stats,
|
| 1151 |
+
"created_at": created_at(),
|
| 1152 |
+
},
|
| 1153 |
+
)
|
| 1154 |
+
print(f"Wrote spatial cache: {out_dir}")
|
| 1155 |
+
return out_dir
|
| 1156 |
+
|
| 1157 |
+
|
| 1158 |
+
def daily_weather_patch_channels(paths: dict[str, Path], years: list[int]) -> list[str]:
|
| 1159 |
+
sample = read_patch_table(paths["weather_daily_patch"], years[:1], columns=None, relative_days=[0])
|
| 1160 |
+
if sample.empty:
|
| 1161 |
+
return []
|
| 1162 |
+
key_cols = {"fire_id", "year", "split", "row", "col", "cell_id", "date", "relative_day"}
|
| 1163 |
+
return [col for col in sample.columns if col not in key_cols and col in TEMPORAL_WEATHER_CHANNELS]
|
| 1164 |
+
|
| 1165 |
+
|
| 1166 |
+
def weather_daily_patch_to_array(
|
| 1167 |
+
paths: dict[str, Path],
|
| 1168 |
+
sample_df: pd.DataFrame,
|
| 1169 |
+
rel_days: list[int],
|
| 1170 |
+
channels: list[str],
|
| 1171 |
+
) -> np.ndarray:
|
| 1172 |
+
n = len(sample_df)
|
| 1173 |
+
t = len(rel_days)
|
| 1174 |
+
c = len(channels)
|
| 1175 |
+
if c == 0:
|
| 1176 |
+
return np.zeros((n, t, 0, PATCH_SIZE, PATCH_SIZE), dtype=np.float32)
|
| 1177 |
+
years = sorted(sample_df["year"].unique().tolist())
|
| 1178 |
+
fire_ids = set(sample_df["fire_id"].astype(str))
|
| 1179 |
+
order = pd.DataFrame({"fire_id": sample_df["fire_id"].astype(str), "fire_order": np.arange(n)})
|
| 1180 |
+
rel_order = pd.DataFrame({"relative_day": rel_days, "time_order": np.arange(t)})
|
| 1181 |
+
weather = read_patch_table(
|
| 1182 |
+
paths["weather_daily_patch"],
|
| 1183 |
+
years,
|
| 1184 |
+
columns=["fire_id", "relative_day", "row", "col", "cell_id"] + channels,
|
| 1185 |
+
relative_days=rel_days,
|
| 1186 |
+
)
|
| 1187 |
+
weather["fire_id"] = weather["fire_id"].astype(str)
|
| 1188 |
+
weather = weather.loc[weather["fire_id"].isin(fire_ids), ["fire_id", "relative_day", "row", "col", "cell_id"] + channels]
|
| 1189 |
+
weather = weather.merge(order, on="fire_id", how="inner").merge(rel_order, on="relative_day", how="inner")
|
| 1190 |
+
weather = weather.sort_values(["fire_order", "time_order", "row", "col"])
|
| 1191 |
+
expected = n * t * CELLS_PER_PATCH
|
| 1192 |
+
if len(weather) != expected:
|
| 1193 |
+
raise ValueError(f"Weather daily patch cannot reshape: got {len(weather)} rows, expected {expected}.")
|
| 1194 |
+
values = weather[channels].apply(pd.to_numeric, errors="coerce").fillna(0.0).to_numpy(dtype=np.float32)
|
| 1195 |
+
return values.reshape(n, t, PATCH_SIZE, PATCH_SIZE, c).transpose(0, 1, 4, 2, 3)
|
| 1196 |
+
|
| 1197 |
+
|
| 1198 |
+
def build_spatiotemporal_cache(args, paths: dict[str, Path]) -> Path:
|
| 1199 |
+
out_dir = output_subdir(args.output_dir, args.task, "spatiotemporal", args.weather_days, args.input_protocol)
|
| 1200 |
+
if (out_dir / "X_train.npy").exists() and not args.overwrite:
|
| 1201 |
+
print(f"Reusing existing spatiotemporal cache: {out_dir}")
|
| 1202 |
+
return out_dir
|
| 1203 |
+
remove_output_dir(out_dir, args.overwrite)
|
| 1204 |
+
|
| 1205 |
+
master = normalize_master_metadata(read_parquet_robust(paths["master"]))
|
| 1206 |
+
samples = apply_input_protocol_sample_filter(filter_task_samples(master, args.task), args.input_protocol)
|
| 1207 |
+
splits = split_frames(samples)
|
| 1208 |
+
sample_index_splits = split_frames(build_sample_index(samples, master, args.task))
|
| 1209 |
+
rel_days = WEATHER_DAY_MAP[args.weather_days]
|
| 1210 |
+
|
| 1211 |
+
split_arrays = {}
|
| 1212 |
+
channel_names = None
|
| 1213 |
+
for split, frame in splits.items():
|
| 1214 |
+
years = sorted(frame["year"].unique().tolist())
|
| 1215 |
+
dynamic_channels = daily_weather_patch_channels(paths, years) if protocol_includes_weather(args.input_protocol) else []
|
| 1216 |
+
X_weather = weather_daily_patch_to_array(paths, frame, rel_days, dynamic_channels)
|
| 1217 |
+
|
| 1218 |
+
static_patch, static_channels = read_joined_spatial_patch(
|
| 1219 |
+
paths, frame, args.input_protocol, args.weather_days, include_weather_daily=True
|
| 1220 |
+
)
|
| 1221 |
+
X_static = patch_to_array(static_patch, frame, static_channels)
|
| 1222 |
+
X_static_repeated = np.repeat(X_static[:, None, :, :, :], len(rel_days), axis=1)
|
| 1223 |
+
X = np.concatenate([X_weather, X_static_repeated], axis=2)
|
| 1224 |
+
split_arrays[split] = X
|
| 1225 |
+
if channel_names is None:
|
| 1226 |
+
channel_names = dynamic_channels + static_channels
|
| 1227 |
+
|
| 1228 |
+
patch_stats = {"indices": [], "mean": [], "std": []}
|
| 1229 |
+
if args.standardize and channel_names:
|
| 1230 |
+
patch_stats = fit_patch_stats_train(split_arrays["train"], channel_names, spatiotemporal=True)
|
| 1231 |
+
for split in split_arrays:
|
| 1232 |
+
split_arrays[split] = apply_patch_standardization(split_arrays[split], patch_stats, spatiotemporal=True)
|
| 1233 |
+
|
| 1234 |
+
for split, frame in splits.items():
|
| 1235 |
+
y = frame["target"].to_numpy(dtype=np.float32)
|
| 1236 |
+
write_split_outputs(out_dir, split, split_arrays[split], y, sample_index_splits[split], args.task)
|
| 1237 |
+
write_json(out_dir / "channel_names.json", {"channel_names": channel_names or []})
|
| 1238 |
+
write_json(out_dir / "relative_days.json", {"relative_days": rel_days})
|
| 1239 |
+
save_metadata(
|
| 1240 |
+
out_dir,
|
| 1241 |
+
{
|
| 1242 |
+
"task": args.task,
|
| 1243 |
+
"representation": "spatiotemporal",
|
| 1244 |
+
"input_protocol": args.input_protocol,
|
| 1245 |
+
"weather_days": args.weather_days,
|
| 1246 |
+
"relative_days": rel_days,
|
| 1247 |
+
"target_column": target_info(args.task)["target_column"],
|
| 1248 |
+
"channel_names": channel_names or [],
|
| 1249 |
+
"split_counts": {split: int(len(frame)) for split, frame in splits.items()},
|
| 1250 |
+
"fire_signal_policy": "VIIRS discovery-day D patch repeated across all T time steps when selected",
|
| 1251 |
+
"missing_value_policy": "patch NaN filled with 0; no mask channels in v1",
|
| 1252 |
+
"scaler_policy": "channel-wise train mean/std for non-categorical non-binary patch channels" if args.standardize else "not_standardized",
|
| 1253 |
+
"channel_stats": patch_stats,
|
| 1254 |
+
"created_at": created_at(),
|
| 1255 |
+
},
|
| 1256 |
+
)
|
| 1257 |
+
print(f"Wrote spatiotemporal cache: {out_dir}")
|
| 1258 |
+
return out_dir
|
| 1259 |
+
|
| 1260 |
+
|
| 1261 |
+
def build_representation(args, paths: dict[str, Path], feature_manifest: dict, representation: str) -> Path:
|
| 1262 |
+
if representation == "tabular":
|
| 1263 |
+
return build_tabular_cache(args, paths, feature_manifest)
|
| 1264 |
+
if representation == "temporal":
|
| 1265 |
+
return build_temporal_cache(args, paths, feature_manifest)
|
| 1266 |
+
if representation == "spatial":
|
| 1267 |
+
return build_spatial_cache(args, paths)
|
| 1268 |
+
if representation == "spatiotemporal":
|
| 1269 |
+
return build_spatiotemporal_cache(args, paths)
|
| 1270 |
+
raise ValueError(representation)
|
| 1271 |
+
|
| 1272 |
+
|
| 1273 |
+
def pass_fail(name: str, ok: bool, detail: str = "") -> bool:
|
| 1274 |
+
status = "PASS" if ok else "FAIL"
|
| 1275 |
+
print(f"[{status}] {name}{': ' + detail if detail else ''}")
|
| 1276 |
+
return ok
|
| 1277 |
+
|
| 1278 |
+
|
| 1279 |
+
def validate_patch_table_sample(name: str, path: Path, max_parts: int = 1, sample_fire_count: int = 3) -> bool:
|
| 1280 |
+
required = ["fire_id", "row", "col", "cell_id"]
|
| 1281 |
+
df = read_parquet_parts_sample(path, columns=required + ["relative_day"], max_parts=max_parts)
|
| 1282 |
+
if df.empty:
|
| 1283 |
+
return pass_fail(f"patch table sample reshape: {name}", False, "no parquet part files read")
|
| 1284 |
+
missing = [col for col in required if col not in df.columns]
|
| 1285 |
+
if missing:
|
| 1286 |
+
return pass_fail(f"patch table sample reshape: {name}", False, f"missing keys={missing}")
|
| 1287 |
+
|
| 1288 |
+
if "relative_day" in df.columns:
|
| 1289 |
+
first_rel = sorted(int(day) for day in df["relative_day"].dropna().unique())[0]
|
| 1290 |
+
df = df.loc[df["relative_day"].astype(int) == first_rel].copy()
|
| 1291 |
+
|
| 1292 |
+
fire_ids = df["fire_id"].astype(str).drop_duplicates().head(sample_fire_count).tolist()
|
| 1293 |
+
if not fire_ids:
|
| 1294 |
+
return pass_fail(f"patch table sample reshape: {name}", False, "no fire_id values in sample")
|
| 1295 |
+
|
| 1296 |
+
details = []
|
| 1297 |
+
ok = True
|
| 1298 |
+
df = df.copy()
|
| 1299 |
+
df["fire_id"] = df["fire_id"].astype(str)
|
| 1300 |
+
duplicate_count = int(df.duplicated(subset=required).sum())
|
| 1301 |
+
if duplicate_count:
|
| 1302 |
+
ok = False
|
| 1303 |
+
details.append(f"duplicate key rows={duplicate_count}")
|
| 1304 |
+
|
| 1305 |
+
for fire_id in fire_ids:
|
| 1306 |
+
group = df.loc[df["fire_id"] == fire_id]
|
| 1307 |
+
checks = {
|
| 1308 |
+
"rows": len(group) == CELLS_PER_PATCH,
|
| 1309 |
+
"row_range": int(group["row"].min()) == 0 and int(group["row"].max()) == PATCH_SIZE - 1,
|
| 1310 |
+
"col_range": int(group["col"].min()) == 0 and int(group["col"].max()) == PATCH_SIZE - 1,
|
| 1311 |
+
"cell_id_nunique": int(group["cell_id"].nunique()) == CELLS_PER_PATCH,
|
| 1312 |
+
}
|
| 1313 |
+
bad = [key for key, passed in checks.items() if not passed]
|
| 1314 |
+
if bad:
|
| 1315 |
+
ok = False
|
| 1316 |
+
details.append(f"fire_id={fire_id} failed {bad}")
|
| 1317 |
+
|
| 1318 |
+
detail = f"sampled_fire_ids={fire_ids}" if ok else "; ".join(details)
|
| 1319 |
+
return pass_fail(f"patch table sample reshape: {name}", ok, detail)
|
| 1320 |
+
|
| 1321 |
+
|
| 1322 |
+
def validate(args, paths: dict[str, Path]) -> bool:
|
| 1323 |
+
print("Validation checks")
|
| 1324 |
+
ok_all = True
|
| 1325 |
+
for key in required_path_keys():
|
| 1326 |
+
ok_all &= pass_fail(f"canonical input exists: {key}", paths[key].exists(), str(paths[key]))
|
| 1327 |
+
if not paths["master"].exists():
|
| 1328 |
+
return False
|
| 1329 |
+
|
| 1330 |
+
feature_manifest = load_json(paths["feature_manifest"]) if paths["feature_manifest"].exists() else {"forbidden_as_features": []}
|
| 1331 |
+
master = normalize_master_metadata(read_parquet_robust(paths["master"]))
|
| 1332 |
+
ok_all &= pass_fail("master_features has one row per fire_id", not master["fire_id"].duplicated().any())
|
| 1333 |
+
|
| 1334 |
+
samples = apply_input_protocol_sample_filter(filter_task_samples(master, args.task), args.input_protocol)
|
| 1335 |
+
splits = split_frames(samples)
|
| 1336 |
+
ok_all &= pass_fail("task filtering works", len(samples) > 0, f"{len(samples)} samples")
|
| 1337 |
+
ok_all &= pass_fail(
|
| 1338 |
+
"train/val/test split counts are nonzero",
|
| 1339 |
+
all(len(frame) > 0 for frame in splits.values()),
|
| 1340 |
+
str({split: len(frame) for split, frame in splits.items()}),
|
| 1341 |
+
)
|
| 1342 |
+
|
| 1343 |
+
target_col = target_info(args.task)["target_column"]
|
| 1344 |
+
feature_cols, removed = requested_feature_columns(
|
| 1345 |
+
feature_manifest, args.input_protocol, args.weather_days, master.columns, target_col
|
| 1346 |
+
)
|
| 1347 |
+
forbidden = set(feature_manifest.get("forbidden_as_features", []))
|
| 1348 |
+
ok_all &= pass_fail("no forbidden columns used as input features", not bool(set(feature_cols) & forbidden))
|
| 1349 |
+
ok_all &= pass_fail("target column is not an input feature", target_col not in feature_cols)
|
| 1350 |
+
future_cols = [col for col in feature_cols if any(token in col.lower() for token in ["d+1", "dplus", "early_48", "post"])]
|
| 1351 |
+
ok_all &= pass_fail("no D+1/D+2/future fire columns are used", len(future_cols) == 0, str(future_cols))
|
| 1352 |
+
|
| 1353 |
+
if paths["weather_daily_event"].exists():
|
| 1354 |
+
weather_days = set(
|
| 1355 |
+
int(day)
|
| 1356 |
+
for day in read_parquet_robust(paths["weather_daily_event"], columns=["relative_day"])["relative_day"].unique()
|
| 1357 |
+
)
|
| 1358 |
+
need = set(WEATHER_DAY_MAP[args.weather_days])
|
| 1359 |
+
ok_all &= pass_fail(
|
| 1360 |
+
"weather relative days exist",
|
| 1361 |
+
need <= weather_days,
|
| 1362 |
+
f"need={sorted(int(day) for day in need)} have={sorted(int(day) for day in weather_days)}",
|
| 1363 |
+
)
|
| 1364 |
+
|
| 1365 |
+
patch_tables = {
|
| 1366 |
+
"grid_index": paths["grid_index"],
|
| 1367 |
+
"static_patch": paths["static_patch"],
|
| 1368 |
+
"viirs_patch": paths["viirs_patch"],
|
| 1369 |
+
"weather_daily_patch": paths["weather_daily_patch"],
|
| 1370 |
+
"weather_aggregate_patch": paths["weather_aggregate_patch"],
|
| 1371 |
+
"osm_patch": paths["osm_patch"],
|
| 1372 |
+
}
|
| 1373 |
+
for name, path in patch_tables.items():
|
| 1374 |
+
if path.exists():
|
| 1375 |
+
ok_all &= validate_patch_table_sample(name, path)
|
| 1376 |
+
|
| 1377 |
+
if args.representation != "all":
|
| 1378 |
+
cache_dir = output_subdir(args.output_dir, args.task, args.representation, args.weather_days, args.input_protocol)
|
| 1379 |
+
if (cache_dir / "X_train.npy").exists():
|
| 1380 |
+
X = np.load(cache_dir / "X_train.npy", mmap_mode="r")
|
| 1381 |
+
ok_all &= pass_fail("output arrays have expected shapes", X.shape[0] == len(splits["train"]), str(X.shape))
|
| 1382 |
+
ok_all &= pass_fail("no NaN remains in saved X arrays", not np.isnan(np.asarray(X[: min(len(X), 10)])).any())
|
| 1383 |
+
else:
|
| 1384 |
+
ok_all &= pass_fail("output arrays have expected shapes", False, f"cache not found: {cache_dir}")
|
| 1385 |
+
return ok_all
|
| 1386 |
+
|
| 1387 |
+
|
| 1388 |
+
def parse_args() -> argparse.Namespace:
|
| 1389 |
+
parser = argparse.ArgumentParser(description="Build Phase 2 model-ready wildfire benchmark caches.")
|
| 1390 |
+
parser.add_argument("--base_dir", default=".")
|
| 1391 |
+
parser.add_argument("--canonical_dir", default="./data/cache/raw_feature_tables")
|
| 1392 |
+
parser.add_argument("--output_dir", default="./data/cache/model_ready")
|
| 1393 |
+
parser.add_argument("--task", choices=["ia_failure", "containment_time"], default="ia_failure")
|
| 1394 |
+
parser.add_argument(
|
| 1395 |
+
"--representation",
|
| 1396 |
+
choices=["tabular", "temporal", "spatial", "spatiotemporal", "all"],
|
| 1397 |
+
default="all",
|
| 1398 |
+
)
|
| 1399 |
+
parser.add_argument("--weather_days", choices=[1, 2, 3, 4, 5], type=int, default=5)
|
| 1400 |
+
parser.add_argument(
|
| 1401 |
+
"--input_protocol",
|
| 1402 |
+
choices=[
|
| 1403 |
+
"metadata",
|
| 1404 |
+
"firms",
|
| 1405 |
+
"fire",
|
| 1406 |
+
"fire_wide",
|
| 1407 |
+
"weather",
|
| 1408 |
+
"fuel",
|
| 1409 |
+
"vegetation",
|
| 1410 |
+
"topography",
|
| 1411 |
+
"access",
|
| 1412 |
+
"human",
|
| 1413 |
+
"metadata_vegetation",
|
| 1414 |
+
"metadata_fuel",
|
| 1415 |
+
"metadata_topography",
|
| 1416 |
+
"metadata_access",
|
| 1417 |
+
"metadata_human",
|
| 1418 |
+
"all_without_fire",
|
| 1419 |
+
"all_without_weather",
|
| 1420 |
+
"all_without_vegetation",
|
| 1421 |
+
"all_without_fuel",
|
| 1422 |
+
"all_without_topography",
|
| 1423 |
+
"all_without_access",
|
| 1424 |
+
"all_without_human",
|
| 1425 |
+
"all",
|
| 1426 |
+
],
|
| 1427 |
+
default="all",
|
| 1428 |
+
)
|
| 1429 |
+
parser.add_argument("--standardize", dest="standardize", action="store_true", default=True)
|
| 1430 |
+
parser.add_argument("--no-standardize", dest="standardize", action="store_false")
|
| 1431 |
+
parser.add_argument("--overwrite", action="store_true")
|
| 1432 |
+
parser.add_argument("--validate-only", action="store_true")
|
| 1433 |
+
return parser.parse_args()
|
| 1434 |
+
|
| 1435 |
+
|
| 1436 |
+
def main() -> None:
|
| 1437 |
+
args = parse_args()
|
| 1438 |
+
args.base_dir = ensure_project_path(Path(args.base_dir))
|
| 1439 |
+
args.canonical_dir = ensure_project_path(Path(args.canonical_dir))
|
| 1440 |
+
args.output_dir = ensure_project_path(Path(args.output_dir))
|
| 1441 |
+
paths = canonical_paths(args.canonical_dir)
|
| 1442 |
+
|
| 1443 |
+
if args.validate_only:
|
| 1444 |
+
ok = validate(args, paths)
|
| 1445 |
+
raise SystemExit(0 if ok else 1)
|
| 1446 |
+
|
| 1447 |
+
missing = [key for key in required_path_keys() if not paths[key].exists()]
|
| 1448 |
+
if missing:
|
| 1449 |
+
details = "\n".join(f" {key}: {paths[key]}" for key in missing)
|
| 1450 |
+
raise FileNotFoundError(f"Missing required Phase 1 canonical inputs:\n{details}")
|
| 1451 |
+
|
| 1452 |
+
feature_manifest, _, _, _ = load_manifests(paths)
|
| 1453 |
+
reps = ["tabular", "temporal", "spatial", "spatiotemporal"] if args.representation == "all" else [args.representation]
|
| 1454 |
+
for representation in reps:
|
| 1455 |
+
build_representation(args, paths, feature_manifest, representation)
|
| 1456 |
+
|
| 1457 |
+
|
| 1458 |
+
if __name__ == "__main__":
|
| 1459 |
+
main()
|
code/summarize_task1_full_all_seeds.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import json
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
+
import pandas as pd
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
BASE_DIR = Path(".")
|
| 10 |
+
EXP_DIR = BASE_DIR / "experiments" / "ia_failure" / "full"
|
| 11 |
+
RESULTS_DIR = BASE_DIR / "results"
|
| 12 |
+
RAW_OUT = RESULTS_DIR / "ia_failure_full_all_seeds_raw.csv"
|
| 13 |
+
AGG_OUT = RESULTS_DIR / "ia_failure_full_all_seeds_mean_std.csv"
|
| 14 |
+
MD_OUT = RESULTS_DIR / "ia_failure_full_all_seeds_mean_std.md"
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
METRIC_COLUMNS = [
|
| 18 |
+
"val_auprc",
|
| 19 |
+
"test_auprc",
|
| 20 |
+
"val_auroc",
|
| 21 |
+
"test_auroc",
|
| 22 |
+
"test_f1",
|
| 23 |
+
"test_precision",
|
| 24 |
+
"test_recall",
|
| 25 |
+
"test_iou",
|
| 26 |
+
"test_brier",
|
| 27 |
+
"test_ece",
|
| 28 |
+
"test_precision_at_1",
|
| 29 |
+
"test_recall_at_1",
|
| 30 |
+
"test_precision_at_5",
|
| 31 |
+
"test_recall_at_5",
|
| 32 |
+
"test_precision_at_10",
|
| 33 |
+
"test_recall_at_10",
|
| 34 |
+
"best_epoch",
|
| 35 |
+
"runtime_seconds",
|
| 36 |
+
]
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def read_metrics(path: Path) -> dict:
|
| 40 |
+
with path.open("r", encoding="utf-8") as file:
|
| 41 |
+
payload = json.load(file)
|
| 42 |
+
row = {
|
| 43 |
+
"task": payload.get("task", "ia_failure"),
|
| 44 |
+
"experiment_type": payload.get("experiment_type", "full"),
|
| 45 |
+
"representation": payload.get("representation", path.parents[2].name if len(path.parents) > 2 else None),
|
| 46 |
+
"model_name": payload.get("model_name", path.parent.name.split("_seed")[0]),
|
| 47 |
+
"seed": payload.get("seed"),
|
| 48 |
+
"output_dir": payload.get("output_dir", str(path.parent)),
|
| 49 |
+
}
|
| 50 |
+
# Backfill from path: full/{representation}/weather5_all/{model}_seed{seed}/metrics.json
|
| 51 |
+
try:
|
| 52 |
+
row["representation"] = path.parents[2].name
|
| 53 |
+
except Exception:
|
| 54 |
+
pass
|
| 55 |
+
for col in METRIC_COLUMNS:
|
| 56 |
+
row[col] = payload.get(col)
|
| 57 |
+
return row
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def main() -> None:
|
| 61 |
+
RESULTS_DIR.mkdir(parents=True, exist_ok=True)
|
| 62 |
+
metrics_paths = sorted(EXP_DIR.glob("*/*/*_seed*/metrics.json"))
|
| 63 |
+
rows = [read_metrics(path) for path in metrics_paths]
|
| 64 |
+
columns = [
|
| 65 |
+
"task",
|
| 66 |
+
"experiment_type",
|
| 67 |
+
"representation",
|
| 68 |
+
"model_name",
|
| 69 |
+
"seed",
|
| 70 |
+
*METRIC_COLUMNS,
|
| 71 |
+
"output_dir",
|
| 72 |
+
]
|
| 73 |
+
raw = pd.DataFrame(rows, columns=columns)
|
| 74 |
+
raw.to_csv(RAW_OUT, index=False)
|
| 75 |
+
|
| 76 |
+
if raw.empty:
|
| 77 |
+
agg = pd.DataFrame(columns=["representation", "model_name", "num_seeds_completed"])
|
| 78 |
+
else:
|
| 79 |
+
numeric_metrics = [col for col in METRIC_COLUMNS if col in raw.columns]
|
| 80 |
+
grouped = raw.groupby(["representation", "model_name"], dropna=False)
|
| 81 |
+
count = grouped["seed"].nunique().rename("num_seeds_completed")
|
| 82 |
+
means = grouped[numeric_metrics].mean(numeric_only=True).add_suffix("_mean")
|
| 83 |
+
stds = grouped[numeric_metrics].std(numeric_only=True).add_suffix("_std")
|
| 84 |
+
agg = pd.concat([count, means, stds], axis=1).reset_index()
|
| 85 |
+
if "test_auprc_mean" in agg.columns:
|
| 86 |
+
agg = agg.sort_values("test_auprc_mean", ascending=False, na_position="last")
|
| 87 |
+
agg.to_csv(AGG_OUT, index=False)
|
| 88 |
+
MD_OUT.write_text(agg.to_markdown(index=False) + "\n", encoding="utf-8")
|
| 89 |
+
|
| 90 |
+
print(f"Read {len(raw)} metrics files from {EXP_DIR}")
|
| 91 |
+
print(f"Wrote {RAW_OUT}")
|
| 92 |
+
print(f"Wrote {AGG_OUT}")
|
| 93 |
+
print(f"Wrote {MD_OUT}")
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
if __name__ == "__main__":
|
| 97 |
+
main()
|
code/summarize_task2_full_all_seeds.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
|
| 7 |
+
import pandas as pd
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
BASE_DIR = Path(".")
|
| 11 |
+
ROOT = BASE_DIR / "experiments" / "containment_time" / "full"
|
| 12 |
+
RESULTS_DIR = BASE_DIR / "results"
|
| 13 |
+
|
| 14 |
+
METRICS = [
|
| 15 |
+
"val_mae_hours",
|
| 16 |
+
"test_mae_hours",
|
| 17 |
+
"val_rmse_hours",
|
| 18 |
+
"test_rmse_hours",
|
| 19 |
+
"val_median_ae_hours",
|
| 20 |
+
"test_median_ae_hours",
|
| 21 |
+
"val_log_mae",
|
| 22 |
+
"test_log_mae",
|
| 23 |
+
"val_log_rmse",
|
| 24 |
+
"test_log_rmse",
|
| 25 |
+
"val_r2",
|
| 26 |
+
"test_r2",
|
| 27 |
+
"val_spearman",
|
| 28 |
+
"test_spearman",
|
| 29 |
+
"val_pearson",
|
| 30 |
+
"test_pearson",
|
| 31 |
+
]
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def read_json(path: Path) -> dict:
|
| 35 |
+
with path.open("r") as f:
|
| 36 |
+
return json.load(f)
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def main() -> None:
|
| 40 |
+
RESULTS_DIR.mkdir(parents=True, exist_ok=True)
|
| 41 |
+
rows = []
|
| 42 |
+
for metrics_path in sorted(ROOT.glob("*/*/*_seed*/metrics.json")):
|
| 43 |
+
m = read_json(metrics_path)
|
| 44 |
+
row = {
|
| 45 |
+
"task": m.get("task"),
|
| 46 |
+
"experiment_type": m.get("experiment_type"),
|
| 47 |
+
"representation": m.get("representation"),
|
| 48 |
+
"model_name": m.get("model_name"),
|
| 49 |
+
"seed": m.get("seed"),
|
| 50 |
+
"best_epoch": m.get("best_epoch"),
|
| 51 |
+
"runtime_seconds": m.get("runtime_seconds"),
|
| 52 |
+
"output_dir": str(metrics_path.parent),
|
| 53 |
+
}
|
| 54 |
+
for metric in METRICS:
|
| 55 |
+
row[metric] = m.get(metric)
|
| 56 |
+
rows.append(row)
|
| 57 |
+
|
| 58 |
+
raw = pd.DataFrame(rows)
|
| 59 |
+
raw_path = RESULTS_DIR / "containment_time_full_all_seeds_raw.csv"
|
| 60 |
+
raw.to_csv(raw_path, index=False)
|
| 61 |
+
|
| 62 |
+
if raw.empty:
|
| 63 |
+
summary = pd.DataFrame()
|
| 64 |
+
else:
|
| 65 |
+
grouped = raw.groupby(["representation", "model_name"], dropna=False)
|
| 66 |
+
parts = []
|
| 67 |
+
for (representation, model_name), g in grouped:
|
| 68 |
+
row = {
|
| 69 |
+
"representation": representation,
|
| 70 |
+
"model_name": model_name,
|
| 71 |
+
"num_seeds_completed": int(g["seed"].nunique()),
|
| 72 |
+
}
|
| 73 |
+
for metric in METRICS:
|
| 74 |
+
row[f"{metric}_mean"] = g[metric].mean()
|
| 75 |
+
row[f"{metric}_std"] = g[metric].std()
|
| 76 |
+
row["best_epoch_mean"] = g["best_epoch"].mean()
|
| 77 |
+
row["runtime_seconds_mean"] = g["runtime_seconds"].mean()
|
| 78 |
+
parts.append(row)
|
| 79 |
+
summary = pd.DataFrame(parts)
|
| 80 |
+
if "test_mae_hours_mean" in summary.columns:
|
| 81 |
+
summary = summary.sort_values("test_mae_hours_mean", ascending=True)
|
| 82 |
+
|
| 83 |
+
summary_path = RESULTS_DIR / "containment_time_full_all_seeds_mean_std.csv"
|
| 84 |
+
md_path = RESULTS_DIR / "containment_time_full_all_seeds_mean_std.md"
|
| 85 |
+
summary.to_csv(summary_path, index=False)
|
| 86 |
+
summary.to_markdown(md_path, index=False)
|
| 87 |
+
|
| 88 |
+
print(f"Read {len(raw)} metrics files from {ROOT}")
|
| 89 |
+
print(f"Wrote {raw_path}")
|
| 90 |
+
print(f"Wrote {summary_path}")
|
| 91 |
+
print(f"Wrote {md_path}")
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
if __name__ == "__main__":
|
| 95 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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"@context": {
|
| 3 |
+
"@language": "en",
|
| 4 |
+
"@vocab": "https://schema.org/",
|
| 5 |
+
"cr": "http://mlcommons.org/croissant/",
|
| 6 |
+
"prov": "http://www.w3.org/ns/prov#",
|
| 7 |
+
"rai": "http://mlcommons.org/croissant/RAI/"
|
| 8 |
+
},
|
| 9 |
+
"@type": "Dataset",
|
| 10 |
+
"alternateName": "WildfireIA",
|
| 11 |
+
"creator": [
|
| 12 |
+
{
|
| 13 |
+
"@type": "Organization",
|
| 14 |
+
"name": "Anonymous Authors"
|
| 15 |
+
}
|
| 16 |
+
],
|
| 17 |
+
"datePublished": "2026-05-07",
|
| 18 |
+
"description": "Event-level multimodal benchmark for predicting whether a Natural wildfire escapes initial attack from public discovery-time data.",
|
| 19 |
+
"distribution": [
|
| 20 |
+
{
|
| 21 |
+
"@id": "canonical_event_grid_375m_index_natural_2016_2020.parquet",
|
| 22 |
+
"@type": "cr:FileSet",
|
| 23 |
+
"contentSize": 573952054,
|
| 24 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet",
|
| 25 |
+
"encodingFormat": "application/x-parquet",
|
| 26 |
+
"name": "event_grid_375m_index_natural_2016_2020.parquet"
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"@id": "canonical_event_osm_patch_375m_natural_2016_2020.parquet",
|
| 30 |
+
"@type": "cr:FileSet",
|
| 31 |
+
"contentSize": 1202885293,
|
| 32 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet",
|
| 33 |
+
"encodingFormat": "application/x-parquet",
|
| 34 |
+
"name": "event_osm_patch_375m_natural_2016_2020.parquet"
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"@id": "canonical_event_patch_manifest_375m_natural.json",
|
| 38 |
+
"@type": "cr:FileObject",
|
| 39 |
+
"contentSize": 747,
|
| 40 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/event_patch_manifest_375m_natural.json",
|
| 41 |
+
"encodingFormat": "application/json",
|
| 42 |
+
"name": "event_patch_manifest_375m_natural.json"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"@id": "canonical_event_static_patch_375m_natural_2016_2020.parquet",
|
| 46 |
+
"@type": "cr:FileSet",
|
| 47 |
+
"contentSize": 507810394,
|
| 48 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet",
|
| 49 |
+
"encodingFormat": "application/x-parquet",
|
| 50 |
+
"name": "event_static_patch_375m_natural_2016_2020.parquet"
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"@id": "canonical_event_viirs_patch_375m_D_natural_2016_2020.parquet",
|
| 54 |
+
"@type": "cr:FileSet",
|
| 55 |
+
"contentSize": 15698914,
|
| 56 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet",
|
| 57 |
+
"encodingFormat": "application/x-parquet",
|
| 58 |
+
"name": "event_viirs_patch_375m_D_natural_2016_2020.parquet"
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"@id": "canonical_event_weather_aggregate_patch_375m_natural_2016_2020.parquet",
|
| 62 |
+
"@type": "cr:FileSet",
|
| 63 |
+
"contentSize": 28359527,
|
| 64 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet",
|
| 65 |
+
"encodingFormat": "application/x-parquet",
|
| 66 |
+
"name": "event_weather_aggregate_patch_375m_natural_2016_2020.parquet"
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"@id": "canonical_event_weather_daily_patch_375m_natural_2016_2020.parquet",
|
| 70 |
+
"@type": "cr:FileSet",
|
| 71 |
+
"contentSize": 56466736,
|
| 72 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet",
|
| 73 |
+
"encodingFormat": "application/x-parquet",
|
| 74 |
+
"name": "event_weather_daily_patch_375m_natural_2016_2020.parquet"
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"@id": "canonical_feature_manifest_natural.json",
|
| 78 |
+
"@type": "cr:FileObject",
|
| 79 |
+
"contentSize": 5736,
|
| 80 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/feature_manifest_natural.json",
|
| 81 |
+
"encodingFormat": "application/json",
|
| 82 |
+
"name": "feature_manifest_natural.json"
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"@id": "canonical_fire_events_natural_2016_2020.parquet",
|
| 86 |
+
"@type": "cr:FileObject",
|
| 87 |
+
"contentSize": 2088352,
|
| 88 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/fire_events_natural_2016_2020.parquet",
|
| 89 |
+
"encodingFormat": "application/x-parquet",
|
| 90 |
+
"name": "fire_events_natural_2016_2020.parquet"
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"@id": "canonical_gridmet_daily_event_features_natural_2016_2020.parquet",
|
| 94 |
+
"@type": "cr:FileObject",
|
| 95 |
+
"contentSize": 4188091,
|
| 96 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/gridmet_daily_event_features_natural_2016_2020.parquet",
|
| 97 |
+
"encodingFormat": "application/x-parquet",
|
| 98 |
+
"name": "gridmet_daily_event_features_natural_2016_2020.parquet"
|
| 99 |
+
},
|
| 100 |
+
{
|
| 101 |
+
"@id": "canonical_gridmet_features_natural_2016_2020.parquet",
|
| 102 |
+
"@type": "cr:FileObject",
|
| 103 |
+
"contentSize": 7569654,
|
| 104 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/gridmet_features_natural_2016_2020.parquet",
|
| 105 |
+
"encodingFormat": "application/x-parquet",
|
| 106 |
+
"name": "gridmet_features_natural_2016_2020.parquet"
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"@id": "canonical_label_manifest_natural.json",
|
| 110 |
+
"@type": "cr:FileObject",
|
| 111 |
+
"contentSize": 1211,
|
| 112 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/label_manifest_natural.json",
|
| 113 |
+
"encodingFormat": "application/json",
|
| 114 |
+
"name": "label_manifest_natural.json"
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"@id": "canonical_landfire_fuel_veg_features_natural_2016_2020.parquet",
|
| 118 |
+
"@type": "cr:FileObject",
|
| 119 |
+
"contentSize": 2460578,
|
| 120 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/landfire_fuel_veg_features_natural_2016_2020.parquet",
|
| 121 |
+
"encodingFormat": "application/x-parquet",
|
| 122 |
+
"name": "landfire_fuel_veg_features_natural_2016_2020.parquet"
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"@id": "canonical_master_features_natural_2016_2020.parquet",
|
| 126 |
+
"@type": "cr:FileObject",
|
| 127 |
+
"contentSize": 15340791,
|
| 128 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/master_features_natural_2016_2020.parquet",
|
| 129 |
+
"encodingFormat": "application/x-parquet",
|
| 130 |
+
"name": "master_features_natural_2016_2020.parquet"
|
| 131 |
+
},
|
| 132 |
+
{
|
| 133 |
+
"@id": "canonical_osm_access_features_natural_2016_2020.parquet",
|
| 134 |
+
"@type": "cr:FileObject",
|
| 135 |
+
"contentSize": 1261348,
|
| 136 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/osm_access_features_natural_2016_2020.parquet",
|
| 137 |
+
"encodingFormat": "application/x-parquet",
|
| 138 |
+
"name": "osm_access_features_natural_2016_2020.parquet"
|
| 139 |
+
},
|
| 140 |
+
{
|
| 141 |
+
"@id": "canonical_population_features_natural_2016_2020.parquet",
|
| 142 |
+
"@type": "cr:FileObject",
|
| 143 |
+
"contentSize": 1597827,
|
| 144 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/population_features_natural_2016_2020.parquet",
|
| 145 |
+
"encodingFormat": "application/x-parquet",
|
| 146 |
+
"name": "population_features_natural_2016_2020.parquet"
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"@id": "canonical_temporal_protocol_manifest_natural.json",
|
| 150 |
+
"@type": "cr:FileObject",
|
| 151 |
+
"contentSize": 960,
|
| 152 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/temporal_protocol_manifest_natural.json",
|
| 153 |
+
"encodingFormat": "application/json",
|
| 154 |
+
"name": "temporal_protocol_manifest_natural.json"
|
| 155 |
+
},
|
| 156 |
+
{
|
| 157 |
+
"@id": "canonical_topography_features_natural_2016_2020.parquet",
|
| 158 |
+
"@type": "cr:FileObject",
|
| 159 |
+
"contentSize": 1485867,
|
| 160 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/topography_features_natural_2016_2020.parquet",
|
| 161 |
+
"encodingFormat": "application/x-parquet",
|
| 162 |
+
"name": "topography_features_natural_2016_2020.parquet"
|
| 163 |
+
},
|
| 164 |
+
{
|
| 165 |
+
"@id": "canonical_viirs_features_natural_2016_2020.parquet",
|
| 166 |
+
"@type": "cr:FileObject",
|
| 167 |
+
"contentSize": 489315,
|
| 168 |
+
"contentUrl": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA/resolve/main/data/canonical/raw_feature_tables/viirs_features_natural_2016_2020.parquet",
|
| 169 |
+
"encodingFormat": "application/x-parquet",
|
| 170 |
+
"name": "viirs_features_natural_2016_2020.parquet"
|
| 171 |
+
}
|
| 172 |
+
],
|
| 173 |
+
"keywords": [
|
| 174 |
+
"wildfire",
|
| 175 |
+
"initial attack",
|
| 176 |
+
"benchmark",
|
| 177 |
+
"geospatial",
|
| 178 |
+
"multimodal"
|
| 179 |
+
],
|
| 180 |
+
"license": "other",
|
| 181 |
+
"name": "WildfireIA Anonymous Benchmark Release",
|
| 182 |
+
"prov:wasDerivedFrom": [
|
| 183 |
+
"FPA-FOD",
|
| 184 |
+
"NASA FIRMS/VIIRS",
|
| 185 |
+
"gridMET",
|
| 186 |
+
"LANDFIRE",
|
| 187 |
+
"OpenStreetMap",
|
| 188 |
+
"WorldPop"
|
| 189 |
+
],
|
| 190 |
+
"prov:wasGeneratedBy": "Canonicalization with pipeline.py followed by deterministic cache generation with dataloader.py using chronological splits and discovery-time input restrictions.",
|
| 191 |
+
"rai:dataBiases": "Potential biases include FPA-FOD reporting practices, VIIRS overpass and cloud/smoke limitations, gridMET gridding uncertainty, LANDFIRE static-layer mismatch, OSM mapping completeness, and WorldPop population-model uncertainty.",
|
| 192 |
+
"rai:dataLimitations": "The benchmark covers 2016--2020 contiguous United States Natural wildfire events that pass quality filters. It does not represent Alaska, Hawaii, non-natural fires, or non-US initial attack systems. The binary failure label is a final-size proxy.",
|
| 193 |
+
"rai:dataSocialImpact": "The benchmark may support transparent research on early wildfire risk ranking. Misuse as an unvalidated operational dispatch tool could reinforce geographic or reporting biases.",
|
| 194 |
+
"rai:dataUseCases": "Reproducible benchmark evaluation, representation comparison, source ablation, and scientific analysis of public discovery-time signals for wildfire initial attack.",
|
| 195 |
+
"rai:hasSyntheticData": false,
|
| 196 |
+
"rai:personalSensitiveInformation": "No direct personal identifiers are included. The data include public wildfire locations, dates, roads, fire-station locations, and population density, which are geospatially sensitive contextual information.",
|
| 197 |
+
"recordSet": [
|
| 198 |
+
{
|
| 199 |
+
"@type": "cr:RecordSet",
|
| 200 |
+
"dataType": "cr:Parquet",
|
| 201 |
+
"description": "FPA-FOD event-level tables, labels, splits, and source-level features.",
|
| 202 |
+
"name": "canonical_event_tables"
|
| 203 |
+
},
|
| 204 |
+
{
|
| 205 |
+
"@type": "cr:RecordSet",
|
| 206 |
+
"dataType": "cr:Parquet",
|
| 207 |
+
"description": "Event-centered 375 m patch canonical tables for spatial and spatiotemporal representations.",
|
| 208 |
+
"name": "canonical_patch_tables"
|
| 209 |
+
}
|
| 210 |
+
],
|
| 211 |
+
"url": "https://huggingface.co/datasets/WildfireIA/Anonymous-WildfireIA",
|
| 212 |
+
"wildfireia:fileInventory": [
|
| 213 |
+
{
|
| 214 |
+
"bytes": 117740069,
|
| 215 |
+
"hardlinked": false,
|
| 216 |
+
"path": "data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2016/part-0.parquet"
|
| 217 |
+
},
|
| 218 |
+
{
|
| 219 |
+
"bytes": 129356687,
|
| 220 |
+
"hardlinked": false,
|
| 221 |
+
"path": "data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2017/part-0.parquet"
|
| 222 |
+
},
|
| 223 |
+
{
|
| 224 |
+
"bytes": 115464826,
|
| 225 |
+
"hardlinked": false,
|
| 226 |
+
"path": "data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2018/part-0.parquet"
|
| 227 |
+
},
|
| 228 |
+
{
|
| 229 |
+
"bytes": 112205544,
|
| 230 |
+
"hardlinked": false,
|
| 231 |
+
"path": "data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2019/part-0.parquet"
|
| 232 |
+
},
|
| 233 |
+
{
|
| 234 |
+
"bytes": 99184928,
|
| 235 |
+
"hardlinked": false,
|
| 236 |
+
"path": "data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2020/part-0.parquet"
|
| 237 |
+
},
|
| 238 |
+
{
|
| 239 |
+
"bytes": 247222585,
|
| 240 |
+
"hardlinked": false,
|
| 241 |
+
"path": "data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2016/part-0.parquet"
|
| 242 |
+
},
|
| 243 |
+
{
|
| 244 |
+
"bytes": 269190752,
|
| 245 |
+
"hardlinked": false,
|
| 246 |
+
"path": "data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2017/part-0.parquet"
|
| 247 |
+
},
|
| 248 |
+
{
|
| 249 |
+
"bytes": 242095433,
|
| 250 |
+
"hardlinked": false,
|
| 251 |
+
"path": "data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2018/part-0.parquet"
|
| 252 |
+
},
|
| 253 |
+
{
|
| 254 |
+
"bytes": 236244864,
|
| 255 |
+
"hardlinked": false,
|
| 256 |
+
"path": "data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2019/part-0.parquet"
|
| 257 |
+
},
|
| 258 |
+
{
|
| 259 |
+
"bytes": 208131659,
|
| 260 |
+
"hardlinked": false,
|
| 261 |
+
"path": "data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2020/part-0.parquet"
|
| 262 |
+
},
|
| 263 |
+
{
|
| 264 |
+
"bytes": 747,
|
| 265 |
+
"hardlinked": false,
|
| 266 |
+
"path": "data/canonical/raw_feature_tables/event_patch_manifest_375m_natural.json"
|
| 267 |
+
},
|
| 268 |
+
{
|
| 269 |
+
"bytes": 104714374,
|
| 270 |
+
"hardlinked": false,
|
| 271 |
+
"path": "data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2016/part-0.parquet"
|
| 272 |
+
},
|
| 273 |
+
{
|
| 274 |
+
"bytes": 112345739,
|
| 275 |
+
"hardlinked": false,
|
| 276 |
+
"path": "data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2017/part-0.parquet"
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"bytes": 101964135,
|
| 280 |
+
"hardlinked": false,
|
| 281 |
+
"path": "data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2018/part-0.parquet"
|
| 282 |
+
},
|
| 283 |
+
{
|
| 284 |
+
"bytes": 100989221,
|
| 285 |
+
"hardlinked": false,
|
| 286 |
+
"path": "data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2019/part-0.parquet"
|
| 287 |
+
},
|
| 288 |
+
{
|
| 289 |
+
"bytes": 87796925,
|
| 290 |
+
"hardlinked": false,
|
| 291 |
+
"path": "data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2020/part-0.parquet"
|
| 292 |
+
},
|
| 293 |
+
{
|
| 294 |
+
"bytes": 3185696,
|
| 295 |
+
"hardlinked": false,
|
| 296 |
+
"path": "data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2016/part-0.parquet"
|
| 297 |
+
},
|
| 298 |
+
{
|
| 299 |
+
"bytes": 3519412,
|
| 300 |
+
"hardlinked": false,
|
| 301 |
+
"path": "data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2017/part-0.parquet"
|
| 302 |
+
},
|
| 303 |
+
{
|
| 304 |
+
"bytes": 3182548,
|
| 305 |
+
"hardlinked": false,
|
| 306 |
+
"path": "data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2018/part-0.parquet"
|
| 307 |
+
},
|
| 308 |
+
{
|
| 309 |
+
"bytes": 3065909,
|
| 310 |
+
"hardlinked": false,
|
| 311 |
+
"path": "data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2019/part-0.parquet"
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"bytes": 2745349,
|
| 315 |
+
"hardlinked": false,
|
| 316 |
+
"path": "data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2020/part-0.parquet"
|
| 317 |
+
},
|
| 318 |
+
{
|
| 319 |
+
"bytes": 5825261,
|
| 320 |
+
"hardlinked": false,
|
| 321 |
+
"path": "data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2016/part-0.parquet"
|
| 322 |
+
},
|
| 323 |
+
{
|
| 324 |
+
"bytes": 6274227,
|
| 325 |
+
"hardlinked": false,
|
| 326 |
+
"path": "data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2017/part-0.parquet"
|
| 327 |
+
},
|
| 328 |
+
{
|
| 329 |
+
"bytes": 5728277,
|
| 330 |
+
"hardlinked": false,
|
| 331 |
+
"path": "data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2018/part-0.parquet"
|
| 332 |
+
},
|
| 333 |
+
{
|
| 334 |
+
"bytes": 5596110,
|
| 335 |
+
"hardlinked": false,
|
| 336 |
+
"path": "data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2019/part-0.parquet"
|
| 337 |
+
},
|
| 338 |
+
{
|
| 339 |
+
"bytes": 4935652,
|
| 340 |
+
"hardlinked": false,
|
| 341 |
+
"path": "data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2020/part-0.parquet"
|
| 342 |
+
},
|
| 343 |
+
{
|
| 344 |
+
"bytes": 2314177,
|
| 345 |
+
"hardlinked": false,
|
| 346 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-1/part-0.parquet"
|
| 347 |
+
},
|
| 348 |
+
{
|
| 349 |
+
"bytes": 2315838,
|
| 350 |
+
"hardlinked": false,
|
| 351 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-2/part-0.parquet"
|
| 352 |
+
},
|
| 353 |
+
{
|
| 354 |
+
"bytes": 2316300,
|
| 355 |
+
"hardlinked": false,
|
| 356 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-3/part-0.parquet"
|
| 357 |
+
},
|
| 358 |
+
{
|
| 359 |
+
"bytes": 2316140,
|
| 360 |
+
"hardlinked": false,
|
| 361 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-4/part-0.parquet"
|
| 362 |
+
},
|
| 363 |
+
{
|
| 364 |
+
"bytes": 2315203,
|
| 365 |
+
"hardlinked": false,
|
| 366 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=0/part-0.parquet"
|
| 367 |
+
},
|
| 368 |
+
{
|
| 369 |
+
"bytes": 2521934,
|
| 370 |
+
"hardlinked": false,
|
| 371 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-1/part-0.parquet"
|
| 372 |
+
},
|
| 373 |
+
{
|
| 374 |
+
"bytes": 2525345,
|
| 375 |
+
"hardlinked": false,
|
| 376 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-2/part-0.parquet"
|
| 377 |
+
},
|
| 378 |
+
{
|
| 379 |
+
"bytes": 2523928,
|
| 380 |
+
"hardlinked": false,
|
| 381 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-3/part-0.parquet"
|
| 382 |
+
},
|
| 383 |
+
{
|
| 384 |
+
"bytes": 2525109,
|
| 385 |
+
"hardlinked": false,
|
| 386 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-4/part-0.parquet"
|
| 387 |
+
},
|
| 388 |
+
{
|
| 389 |
+
"bytes": 2521295,
|
| 390 |
+
"hardlinked": false,
|
| 391 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=0/part-0.parquet"
|
| 392 |
+
},
|
| 393 |
+
{
|
| 394 |
+
"bytes": 2276868,
|
| 395 |
+
"hardlinked": false,
|
| 396 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-1/part-0.parquet"
|
| 397 |
+
},
|
| 398 |
+
{
|
| 399 |
+
"bytes": 2281029,
|
| 400 |
+
"hardlinked": false,
|
| 401 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-2/part-0.parquet"
|
| 402 |
+
},
|
| 403 |
+
{
|
| 404 |
+
"bytes": 2276931,
|
| 405 |
+
"hardlinked": false,
|
| 406 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-3/part-0.parquet"
|
| 407 |
+
},
|
| 408 |
+
{
|
| 409 |
+
"bytes": 2278307,
|
| 410 |
+
"hardlinked": false,
|
| 411 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-4/part-0.parquet"
|
| 412 |
+
},
|
| 413 |
+
{
|
| 414 |
+
"bytes": 2273496,
|
| 415 |
+
"hardlinked": false,
|
| 416 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=0/part-0.parquet"
|
| 417 |
+
},
|
| 418 |
+
{
|
| 419 |
+
"bytes": 2213472,
|
| 420 |
+
"hardlinked": false,
|
| 421 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2019/relative_day=-1/part-0.parquet"
|
| 422 |
+
},
|
| 423 |
+
{
|
| 424 |
+
"bytes": 2212169,
|
| 425 |
+
"hardlinked": false,
|
| 426 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2019/relative_day=-2/part-0.parquet"
|
| 427 |
+
},
|
| 428 |
+
{
|
| 429 |
+
"bytes": 2212340,
|
| 430 |
+
"hardlinked": false,
|
| 431 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2019/relative_day=-3/part-0.parquet"
|
| 432 |
+
},
|
| 433 |
+
{
|
| 434 |
+
"bytes": 2213338,
|
| 435 |
+
"hardlinked": false,
|
| 436 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2019/relative_day=-4/part-0.parquet"
|
| 437 |
+
},
|
| 438 |
+
{
|
| 439 |
+
"bytes": 2214069,
|
| 440 |
+
"hardlinked": false,
|
| 441 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2019/relative_day=0/part-0.parquet"
|
| 442 |
+
},
|
| 443 |
+
{
|
| 444 |
+
"bytes": 1964914,
|
| 445 |
+
"hardlinked": false,
|
| 446 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2020/relative_day=-1/part-0.parquet"
|
| 447 |
+
},
|
| 448 |
+
{
|
| 449 |
+
"bytes": 1963442,
|
| 450 |
+
"hardlinked": false,
|
| 451 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2020/relative_day=-2/part-0.parquet"
|
| 452 |
+
},
|
| 453 |
+
{
|
| 454 |
+
"bytes": 1964110,
|
| 455 |
+
"hardlinked": false,
|
| 456 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2020/relative_day=-3/part-0.parquet"
|
| 457 |
+
},
|
| 458 |
+
{
|
| 459 |
+
"bytes": 1963620,
|
| 460 |
+
"hardlinked": false,
|
| 461 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2020/relative_day=-4/part-0.parquet"
|
| 462 |
+
},
|
| 463 |
+
{
|
| 464 |
+
"bytes": 1963362,
|
| 465 |
+
"hardlinked": false,
|
| 466 |
+
"path": "data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2020/relative_day=0/part-0.parquet"
|
| 467 |
+
},
|
| 468 |
+
{
|
| 469 |
+
"bytes": 5736,
|
| 470 |
+
"hardlinked": false,
|
| 471 |
+
"path": "data/canonical/raw_feature_tables/feature_manifest_natural.json"
|
| 472 |
+
},
|
| 473 |
+
{
|
| 474 |
+
"bytes": 2088352,
|
| 475 |
+
"hardlinked": false,
|
| 476 |
+
"path": "data/canonical/raw_feature_tables/fire_events_natural_2016_2020.parquet"
|
| 477 |
+
},
|
| 478 |
+
{
|
| 479 |
+
"bytes": 4188091,
|
| 480 |
+
"hardlinked": false,
|
| 481 |
+
"path": "data/canonical/raw_feature_tables/gridmet_daily_event_features_natural_2016_2020.parquet"
|
| 482 |
+
},
|
| 483 |
+
{
|
| 484 |
+
"bytes": 7569654,
|
| 485 |
+
"hardlinked": false,
|
| 486 |
+
"path": "data/canonical/raw_feature_tables/gridmet_features_natural_2016_2020.parquet"
|
| 487 |
+
},
|
| 488 |
+
{
|
| 489 |
+
"bytes": 1211,
|
| 490 |
+
"hardlinked": false,
|
| 491 |
+
"path": "data/canonical/raw_feature_tables/label_manifest_natural.json"
|
| 492 |
+
},
|
| 493 |
+
{
|
| 494 |
+
"bytes": 2460578,
|
| 495 |
+
"hardlinked": false,
|
| 496 |
+
"path": "data/canonical/raw_feature_tables/landfire_fuel_veg_features_natural_2016_2020.parquet"
|
| 497 |
+
},
|
| 498 |
+
{
|
| 499 |
+
"bytes": 15340791,
|
| 500 |
+
"hardlinked": false,
|
| 501 |
+
"path": "data/canonical/raw_feature_tables/master_features_natural_2016_2020.parquet"
|
| 502 |
+
},
|
| 503 |
+
{
|
| 504 |
+
"bytes": 1261348,
|
| 505 |
+
"hardlinked": false,
|
| 506 |
+
"path": "data/canonical/raw_feature_tables/osm_access_features_natural_2016_2020.parquet"
|
| 507 |
+
},
|
| 508 |
+
{
|
| 509 |
+
"bytes": 1597827,
|
| 510 |
+
"hardlinked": false,
|
| 511 |
+
"path": "data/canonical/raw_feature_tables/population_features_natural_2016_2020.parquet"
|
| 512 |
+
},
|
| 513 |
+
{
|
| 514 |
+
"bytes": 960,
|
| 515 |
+
"hardlinked": false,
|
| 516 |
+
"path": "data/canonical/raw_feature_tables/temporal_protocol_manifest_natural.json"
|
| 517 |
+
},
|
| 518 |
+
{
|
| 519 |
+
"bytes": 1485867,
|
| 520 |
+
"hardlinked": false,
|
| 521 |
+
"path": "data/canonical/raw_feature_tables/topography_features_natural_2016_2020.parquet"
|
| 522 |
+
},
|
| 523 |
+
{
|
| 524 |
+
"bytes": 489315,
|
| 525 |
+
"hardlinked": false,
|
| 526 |
+
"path": "data/canonical/raw_feature_tables/viirs_features_natural_2016_2020.parquet"
|
| 527 |
+
}
|
| 528 |
+
]
|
| 529 |
+
}
|
data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2016/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cafcf142739f258a1e219d13c7ba4a532070bd24f3de1e4fe6a3dadeaad07e60
|
| 3 |
+
size 117740069
|
data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2017/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a0ecb037c6a91d5aef2e579cd1ddf0a6e14d6ed121031c3d3c7134bbb4943e20
|
| 3 |
+
size 129356687
|
data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2018/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c53695496c1ea1c77acded13503b692f88944e7e71fb131db0370c6c2b840dc
|
| 3 |
+
size 115464826
|
data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2019/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7d23d69fcc5d985804517f7bc79f991a1bae0f8c33c45eee1c90deba94eff4c2
|
| 3 |
+
size 112205544
|
data/canonical/raw_feature_tables/event_grid_375m_index_natural_2016_2020.parquet/year=2020/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:09bbb4c0704ffdda70eb37ff10b534831f926df404c9ee0be035da5ac2c03bb9
|
| 3 |
+
size 99184928
|
data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2016/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c5815e4782283bc46897342e3837916e14402c41d90cabcfd9d94911f06f7d6b
|
| 3 |
+
size 247222585
|
data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2017/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c0494108823b2742ede3da0065998a3c1c822606211f22dc21c518e110754ba
|
| 3 |
+
size 269190752
|
data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2018/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:21d95550f4ebafc74782fe98d49cc94cd5caf19f5a1621a6cb79ffea161b93df
|
| 3 |
+
size 242095433
|
data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2019/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f6215d3aaf6b87b9f4e5114fff6781fca4dc24e2b6ae587f870ef82ff2dd5298
|
| 3 |
+
size 236244864
|
data/canonical/raw_feature_tables/event_osm_patch_375m_natural_2016_2020.parquet/year=2020/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f12187926aa3556fcfa796d16a780bca1e60f3d0b6a1cf1cc35be065c59a5c4
|
| 3 |
+
size 208131659
|
data/canonical/raw_feature_tables/event_patch_manifest_375m_natural.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cell_size_m": 375,
|
| 3 |
+
"center_cell": [
|
| 4 |
+
14,
|
| 5 |
+
14
|
| 6 |
+
],
|
| 7 |
+
"crs": "EPSG:5070",
|
| 8 |
+
"outputs": {
|
| 9 |
+
"grid_index": "event_grid_375m_index_natural_2016_2020.parquet",
|
| 10 |
+
"osm_patch": "event_osm_patch_375m_natural_2016_2020.parquet",
|
| 11 |
+
"static_patch": "event_static_patch_375m_natural_2016_2020.parquet",
|
| 12 |
+
"viirs_patch_D": "event_viirs_patch_375m_D_natural_2016_2020.parquet",
|
| 13 |
+
"weather_aggregate_patch": "event_weather_aggregate_patch_375m_natural_2016_2020.parquet",
|
| 14 |
+
"weather_daily_patch": "event_weather_daily_patch_375m_natural_2016_2020.parquet"
|
| 15 |
+
},
|
| 16 |
+
"patch_radius_m": 5000,
|
| 17 |
+
"patch_size": [
|
| 18 |
+
29,
|
| 19 |
+
29
|
| 20 |
+
],
|
| 21 |
+
"sample_unit": "FPA-FOD Natural wildfire event",
|
| 22 |
+
"spatial_unit": "fire_id x 375m event-centered grid cell"
|
| 23 |
+
}
|
data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2016/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f43e32cf4f2d20bbd79c51db8e285df9b32108f28098700821f86b6b5c378303
|
| 3 |
+
size 104714374
|
data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2017/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1d397a0ef0e77ffb19175fad3b9d16343a11e469d42cc4b062f9b53a2bc9d42
|
| 3 |
+
size 112345739
|
data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2018/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:682c0ad7411b75c18ff1f2f0d4bbad35931cee4a4343c9c934fa145c0408769a
|
| 3 |
+
size 101964135
|
data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2019/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d0dc064fe78f40f6af812bd27b9442ef3d20d2b5ac54c8d1ac465104b0bb9af2
|
| 3 |
+
size 100989221
|
data/canonical/raw_feature_tables/event_static_patch_375m_natural_2016_2020.parquet/year=2020/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b2d717848887fb9af74de4343075444c4be1dc0f05001a393b03b7e425ae697
|
| 3 |
+
size 87796925
|
data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2016/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:99186a9bb88075d77c19d743bebb24ac759bfeef38bf3e95cee3972fc3aeb2b4
|
| 3 |
+
size 3185696
|
data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2017/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:833591ec15b1a698537145d908f357884120662c0640fe684dc6b6aa74a8ddda
|
| 3 |
+
size 3519412
|
data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2018/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:216f961a4e12abf7d70bfeae0f1c965d0dee6bcf06d0d455adaf8f1313b1162e
|
| 3 |
+
size 3182548
|
data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2019/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:345d9d23d2f7812b00594051433a4a0d7b88b905a3e98b78a4a4adb3e5f8bbc6
|
| 3 |
+
size 3065909
|
data/canonical/raw_feature_tables/event_viirs_patch_375m_D_natural_2016_2020.parquet/year=2020/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9466b9c6c17c95164efa3834e838e25b4eae276f8079bd81c5c47be05ad32448
|
| 3 |
+
size 2745349
|
data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2016/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d28cc76b4d61f2e188601071203917a7a4a70cc0efe13cd5540666af4cca0a47
|
| 3 |
+
size 5825261
|
data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2017/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6fc5f12fe8969281aa574c212ef4cf20c427996eac50ffbda7284f8d2a1527f
|
| 3 |
+
size 6274227
|
data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2018/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:50657d11e27ae1d4d31025174a617e32ef393026f56ba3b922007bf38f6d90c7
|
| 3 |
+
size 5728277
|
data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2019/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4ca05eee871c9e0086f0e85c045878013521305c01d9c22a2ff58b18edead29f
|
| 3 |
+
size 5596110
|
data/canonical/raw_feature_tables/event_weather_aggregate_patch_375m_natural_2016_2020.parquet/year=2020/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d86e2ef3579c5d8e16efe0ad86cdd77754a2a3701ff5509615ca608faf54f278
|
| 3 |
+
size 4935652
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-1/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fe079d4acb4d93c6bf478f7aea00920a67f163889e4e458cd7ee08f69c1c9a83
|
| 3 |
+
size 2314177
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-2/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:adf1de20b39b3e888ce580985b30f65711ee7e5a90cd831d29f1cc5a86251211
|
| 3 |
+
size 2315838
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-3/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8da6ae39e0eeab0d54edb55399f0732f1086cba7022cf92b8efacc83991f1dd3
|
| 3 |
+
size 2316300
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=-4/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f381784b01db8683f3393a3abae1fdbde9fd5a61212f10ab1ddbb743f9ab9e9f
|
| 3 |
+
size 2316140
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2016/relative_day=0/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3dbec44ddb0120c9030d45ff3bdf54212241d39c2bfd4f1ef75a1fcc33798a59
|
| 3 |
+
size 2315203
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-1/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be2e1c6138bdbb01b3007582a7fe80358f3f5a71bd1213c43ec722d9ad3c3f32
|
| 3 |
+
size 2521934
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-2/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46b769c42c0126a9c299e1cbdf766ad3c0b696fb911e606eb99d249ee00571e4
|
| 3 |
+
size 2525345
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-3/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9b190bba44468964be4fa91d31d2c732c8a41cf74eab1a531e21ddef8fa74387
|
| 3 |
+
size 2523928
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=-4/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a816da28164576b9272c260f0612bdcc07a0526e52f8dfbb771261b6f97ee6ec
|
| 3 |
+
size 2525109
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2017/relative_day=0/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac2aaff1b13c590c28ccfaf91d41534d15d3583929cb70af166a56d80d03782a
|
| 3 |
+
size 2521295
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-1/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d631037294036e25033bcfcd73fadd08600e9c2245b785d33c768ccaf4afed27
|
| 3 |
+
size 2276868
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-2/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7272ccc8fa00482ddbc1b2e2d6e4d1d230c8f6cc6fce51f64d9627fea61c774b
|
| 3 |
+
size 2281029
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-3/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:76143c9b3a0296b544ada667d6f6d38ef984c5d58bddadd4dc2d9ca94570cff2
|
| 3 |
+
size 2276931
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=-4/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4830159585cd146d9608f1bc235ad7680ce7e4d577f0603db957966c7a5dd0aa
|
| 3 |
+
size 2278307
|
data/canonical/raw_feature_tables/event_weather_daily_patch_375m_natural_2016_2020.parquet/year=2018/relative_day=0/part-0.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:148418e46b1ab4bc1399d41ea7a7826a55ae9a388ba4ee288e319522e754a812
|
| 3 |
+
size 2273496
|