JoodAlfadhel spiralizing commited on
Commit
cdc7ec2
·
0 Parent(s):

Duplicate from CMU-OSPO/protostar-climate-submission-template

Browse files

Co-authored-by: Alfredo Gonzalez-Espinoza <spiralizing@users.noreply.huggingface.co>

Files changed (7) hide show
  1. .gitattributes +60 -0
  2. README.md +99 -0
  3. code/AGENTS.md +27 -0
  4. code/README.md +12 -0
  5. code/check_submission.py +39 -0
  6. data/README.md +34 -0
  7. submission.csv +0 -0
.gitattributes ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
README.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: "Protostar Climate Challenge Submission: <Team Name>"
3
+ license: cc-by-4.0
4
+ task_categories:
5
+ - time-series-forecasting
6
+ tags:
7
+ - climate
8
+ - forecasting
9
+ - protostar-climate-2026
10
+ configs:
11
+ - config_name: default
12
+ data_files:
13
+ - split: test
14
+ path: submission.csv
15
+ ---
16
+
17
+ > 📋 **This is the submission template** for the [Protostar Challenge: Climate Risk Intelligence](https://huggingface.co/spaces/CMU-OSPO/protostar-challenge-climate-risk-intelligence). Copy it into your Hugging Face account, fill it in, and **delete this box** when you are done.
18
+ >
19
+ > 1. **Copy:** `hf download CMU-OSPO/protostar-climate-submission-template --repo-type dataset --local-dir my-submission`, then `hf upload <your-name>/<dataset-name> my-submission . --repo-type dataset` (or create a new dataset on the Hub and upload these files).
20
+ > 2. **Fill in** the `predicted_value` column of `submission.csv`: the city, year and metric of all 5,880 rows (210 cities × 7 years × 4 metrics) are already there. Check it with `python code/check_submission.py`.
21
+ > 3. **Replace** every `<...>` placeholder in this README, including `<Team Name>` in the header.
22
+ > 4. **Add** your notebooks or scripts to `code/`, and the curated data they use to `data/`: together they should reproduce `submission.csv`. Fill in the data card in `data/README.md`. If you use an AI agent, start from `code/AGENTS.md`.
23
+ > 5. **Make the dataset public** and paste its link in the *Submission* tab of the challenge Space.
24
+ >
25
+ > Keep the tag `protostar-climate-2026` in the header: it is how submissions are found.
26
+
27
+ # <Team Name>: Protostar Climate Challenge Submission
28
+
29
+ **Negative result:** no <!-- Write "yes" if your main finding is why reuse or reproduction did not work. -->
30
+
31
+ Forecasts of yearly weather for 210 U.S. cities, 2019–2025, made as of the end of 2018 (no data that reveals 2019–2025 weather), for the [Protostar Challenge: Climate Risk Intelligence](https://huggingface.co/spaces/CMU-OSPO/protostar-challenge-climate-risk-intelligence).
32
+
33
+ ## Team
34
+
35
+ | Name | Hugging Face username | University, Program |
36
+ |---|---|---|
37
+ | <Name> | <@username> | <e.g., Carnegie Mellon University, Heinz MSPPM> |
38
+
39
+ ## Method
40
+
41
+ <!-- A few lines: what model you used, which features, and how you checked it (e.g., trained up to 2010, tested on 2011–2018). -->
42
+
43
+ - **Model:** <e.g., 10-year average plus a linear trend, per city>
44
+ - **Features:** <e.g., the last 30 years of each metric>
45
+ - **How we checked it:** <e.g., practice run on 2011–2018: CDD MAE = ... °F-days>
46
+
47
+ ## AI Tools and Agents
48
+
49
+ <!-- List every LLM or agent you used, or write "none". AI tools may write code and help with text; they may not produce forecast values (see the FAQ in the challenge's Data & submission tab). For ideas on documenting LLM and agent use: https://guides.library.cmu.edu/LLMDocumentationGuide -->
50
+
51
+ - **Tools and models:** <none, or e.g., Claude Code (Claude Sonnet 5.5), ChatGPT (GPT-…)>
52
+ - **What they did:** <e.g., wrote the data-loading code, ran the backtests, drafted the README>
53
+ - **What a person reviewed:** <e.g., every download, all model code, the final numbers>
54
+ - **Agent instructions file:** <e.g., code/AGENTS.md, or none>
55
+
56
+ ## Policy Idea
57
+
58
+ <!-- Half a page at most. Answer the three questions however you like. -->
59
+
60
+ 1. **What risk did we notice?** <...>
61
+ 2. **What would we do about it, and who would do it?** <...>
62
+ 3. **Why is it sustainable?** <...>
63
+
64
+ ## Feedback to the Ecosystem
65
+
66
+ <!-- What got in the way, and what would fix it: data, metadata, documentation, licensing, tools, infrastructure, policy. Be specific. -->
67
+
68
+ - **What got in the way:** <...>
69
+ - **What would fix it:** <...>
70
+
71
+ ## Files
72
+
73
+ | File | Content |
74
+ |---|---|
75
+ | `submission.csv` | Our forecasts: `city_id,year,metric,predicted_value` |
76
+ | `code/` | <Our notebooks or scripts> |
77
+ | `data/` | The curated data our code uses; described in its data card, [`data/README.md`](data/README.md) |
78
+
79
+ **Metric codes:** `annual_avg_temp` (°F), `total_precip_in` (inches), `hottest_day_temp` (°F), `cdd` (°F-days).
80
+ **City IDs:** the station `ID` from the `city_info` table of the training dataset (e.g., Pittsburgh = `USW00094823`).
81
+
82
+ ## How to Reproduce
83
+
84
+ <!-- The steps someone else would follow to recreate submission.csv. -->
85
+
86
+ 1. <e.g., install the packages in code/requirements.txt>
87
+ 2. <e.g., run code/forecast.ipynb, which reads data/ and writes submission.csv>
88
+
89
+ ## Data
90
+
91
+ <!-- List every external source (name, link, years used) and say whether it was used for the forecasts or only for the analysis and policy idea. Forecast inputs: weather records up to 2018-12-31, and data from any year that does not respond to the weather. -->
92
+
93
+ - **External data:** <none, or: name, link, years, forecast or analysis>
94
+ - **Curated data:** see the data card in [`data/README.md`](data/README.md) (each file, its source, license and preparation).
95
+
96
+ Training data: [`CMU-OSPO/protostar-climate-train-to-2018`](https://huggingface.co/datasets/CMU-OSPO/protostar-climate-train-to-2018), from:
97
+
98
+ - Lai, Y., & Dzombak, D. A. (2019). Compiled historical daily temperature and precipitation data for selected 210 U.S. cities. Carnegie Mellon University. https://doi.org/10.1184/R1/7890488.v6
99
+ - Lai, Y., & Dzombak, D. A. (2019). *Use of historical data to assess regional climate change.* Journal of Climate, 32(14), 4299–4320. https://doi.org/10.1175/JCLI-D-18-0630.1
code/AGENTS.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Claude Code users: copy this file to CLAUDE.md, or put @code/AGENTS.md in your CLAUDE.md. -->
2
+
3
+ # Instructions for AI agents
4
+
5
+ This repository is a submission to the Protostar Challenge: Climate Risk Intelligence. Follow these rules in every task.
6
+
7
+ ## Data rule (never break it)
8
+
9
+ - Forecasts are made as of 2018-12-31. Weather data used as a forecast input must be dated on or before 2018-12-31.
10
+ - Do not download, query or use weather observations dated 2019-01-01 or later, from any source (e.g., NOAA, Meteostat, Open-Meteo, ERA5, weather websites), nor 2019–2025 data driven by the weather (e.g., streamflow, air quality, energy demand).
11
+ - Set an end date of 2018-12-31 or earlier on every weather download.
12
+ - Never write `predicted_value` from memory or from a web search: every value must come from the code's model.
13
+ - If a task seems to need weather data after 2018, stop and ask a team member.
14
+ - Data that does not respond to the weather (e.g., census, land cover, elevation) may come from any year; record its source in `data/README.md`.
15
+
16
+ ## Working rules
17
+
18
+ - Training data: `CMU-OSPO/protostar-climate-train-to-2018` (Hugging Face).
19
+ - Code goes in `code/`, curated data in `data/` (described in `data/README.md`).
20
+ - After changing `submission.csv`, run `python code/check_submission.py`.
21
+ - The code must reproduce `submission.csv` without an agent (scripts or notebooks that run top to bottom).
22
+ - Never write tokens or credentials into any file.
23
+ - Summarize what you did in the README's "AI Tools and Agents" section.
24
+
25
+ ## Team notes
26
+
27
+ <!-- Add your team's own instructions below. -->
code/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Code
2
+
3
+ Put the notebooks or scripts that produce `submission.csv` here, for example:
4
+
5
+ - `forecast.ipynb`: loads the training data, fits the model, writes `submission.csv`
6
+ - `requirements.txt`: the packages it needs
7
+
8
+ `AGENTS.md` (from the template): instructions for AI agents, including the data rule. Keep it if you use an agent.
9
+
10
+ `check_submission.py` (from the template) checks `submission.csv` before you submit: `python code/check_submission.py`.
11
+
12
+ This dataset is a git repository, so you can push code like any other file. Replace this note with a short description of your files.
code/check_submission.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Check submission.csv before you submit: the same checks the challenge Space runs.
2
+
3
+ Usage: python code/check_submission.py [path/to/submission.csv]
4
+ Needs pandas and huggingface_hub (to read the list of cities from the training dataset).
5
+ """
6
+
7
+ import sys
8
+
9
+ import pandas as pd
10
+
11
+ TRAIN = "hf://datasets/CMU-OSPO/protostar-climate-train-to-2018/city_info"
12
+ COLUMNS = ["city_id", "year", "metric", "predicted_value"]
13
+ YEARS = set(range(2019, 2026))
14
+ METRICS = {"annual_avg_temp", "total_precip_in", "hottest_day_temp", "cdd"}
15
+
16
+ path = sys.argv[1] if len(sys.argv) > 1 else "submission.csv"
17
+ cities = set(pd.read_parquet(TRAIN)["ID"])
18
+ df = pd.read_csv(path, dtype={"city_id": str, "metric": str})
19
+
20
+ if list(df.columns) != COLUMNS:
21
+ sys.exit(f"Columns must be exactly: {','.join(COLUMNS)} (found: {','.join(df.columns)})")
22
+
23
+ year = pd.to_numeric(df["year"], errors="coerce")
24
+ value = pd.to_numeric(df["predicted_value"], errors="coerce")
25
+ checks = {
26
+ "unknown city_id": ~df["city_id"].isin(cities),
27
+ "year outside 2019-2025": ~year.isin(YEARS),
28
+ "unknown metric": ~df["metric"].isin(METRICS),
29
+ "missing or non-numeric predicted_value": value.isna() | value.abs().eq(float("inf")),
30
+ "duplicate row": df.duplicated(["city_id", "year", "metric"]),
31
+ }
32
+ problems = [f"{mask.sum()} rows with {what}, e.g. line {mask.idxmax() + 2}" for what, mask in checks.items() if mask.any()]
33
+ expected = len(cities) * len(YEARS) * len(METRICS)
34
+ if not problems and len(df) != expected:
35
+ problems.append(f"{len(df)} rows; expected {expected}")
36
+
37
+ if problems:
38
+ sys.exit("Not ready:\n- " + "\n- ".join(problems))
39
+ print(f"OK: {path} has all {expected} forecasts and can be scored.")
data/README.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Data card: `data/`
2
+
3
+ <!-- The curated data your code (`code/`) reads, as you prepared it. Together, code and data should reproduce `submission.csv`.
4
+ Fill in this card for every file here, and delete the example rows and these comments.
5
+ If a source is too large, or its license does not allow copying, do not upload it: list it below with its exact version and how to download it. -->
6
+
7
+ ## Files
8
+
9
+ | File | What it holds | Source | License | Years covered | How we prepared it | Used for |
10
+ |---|---|---|---|---|---|---|
11
+ | <`annual_valid.csv`> | <One row per city and year: the four metrics> | <[Challenge dataset](https://huggingface.co/datasets/CMU-OSPO/protostar-climate-train-to-2018), `annual_indices`> | <CC0-1.0> | <1989–2018> | <Kept years with at most 10 missing days> | <Forecast input> |
12
+ | <`city_tree_canopy.csv`> | <Tree canopy share per city> | <NLCD 2016, link> | <Public domain> | <2016> | <Averaged within 5 km of each station; joined by `city_id`> | <Forecast input / analysis only> |
13
+
14
+ ## Not uploaded (download instead)
15
+
16
+ <!-- Delete this section if every file is uploaded. -->
17
+
18
+ | Source | Exact version | How to download | Why not uploaded |
19
+ |---|---|---|---|
20
+ | <Name, link> | <Version, date or DOI> | <Command or steps> | <Too large / license> |
21
+
22
+ ## How the files fit together
23
+
24
+ - **Join key:** <e.g., `city_id` = the station `ID` in the challenge `city_info` table>
25
+ - **Units:** <e.g., °F, inches, °F-days; any conversions you made>
26
+ - **Known limitations:** <e.g., missing years, estimated values, coverage gaps>
27
+
28
+ ## Data rule check
29
+
30
+ <!-- Forecast inputs: weather records up to 2018-12-31, and data from any year that does not respond to the weather.
31
+ 2019–2025 data that responds to the weather may be used only for the analysis and policy idea (see the FAQ in the challenge Space). -->
32
+
33
+ - [ ] Every file marked "Forecast input" is weather data up to 2018-12-31, or data that does not respond to the weather.
34
+ - [ ] Files with 2019–2025 data that responds to the weather are marked "Analysis only" and are not read by the forecasting code.
submission.csv ADDED
The diff for this file is too large to render. See raw diff