-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #821 from CliMA/gb/leaderboard
Add other models to leaderboard
- Loading branch information
Showing
17 changed files
with
151 additions
and
70 deletions.
There are no files selected for viewing
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,8 +36,18 @@ jobs: | |
${{ runner.os }}-test- | ||
${{ runner.os }}- | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
|
||
# Needed to download its unique artifacts | ||
- name: "Instantiate ClimaEarth" | ||
run: julia --color=yes --project=experiments/ClimaEarth -e 'using Pkg; Pkg.instantiate()' | ||
|
||
- uses: julia-actions/julia-runtest@v1 | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: lcov.info | ||
- name: Submit coverage | ||
if: ${{ matrix.version == '1.10' }} && ${{ matrix.os == 'ubuntu-latest' }} | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import Statistics: median | ||
|
||
pr_file_path = joinpath(@clima_artifact("cmip_model_rmse"), "pr_rmse_amip_pr_amip_5yr.csv") | ||
|
||
open(pr_file_path, "r") do io | ||
# Skip the header | ||
header = readline(io) | ||
|
||
# Process each line | ||
for line in eachline(io) | ||
# Split the line by comma | ||
fields = split(line, ',') | ||
model_name = fields[1] | ||
DJF, MAM, JJA, SON, ANN = map(x -> parse(Float64, x), fields[2:end]) | ||
|
||
push!(OTHER_MODELS_RMSEs["pr"], RMSEs(; model_name, DJF, MAM, JJA, SON, ANN)) | ||
end | ||
end | ||
|
||
""" | ||
best_single_model(RMSEs) | ||
Return the one model that has the overall smallest error. | ||
""" | ||
function best_single_model(RMSEs) | ||
_, index = findmin(r -> abs.(values(r)), RMSEs) | ||
return RMSEs[index] | ||
end | ||
|
||
""" | ||
RSME_stats(RMSEs) | ||
Return: | ||
- best single model | ||
- "model" with all the medians | ||
- "model" with all the best values | ||
- "model" with all the worst values | ||
""" | ||
function RSME_stats(vecRMSEs) | ||
# Collect into vectors that we can process independently | ||
all_values = stack(values.(vecRMSEs)) | ||
ANN, DJF, JJA, MAM, SON = ntuple(i -> all_values[i, :], 5) | ||
|
||
median_model = RMSEs(; | ||
model_name = "Median", | ||
ANN = median(ANN), | ||
DJF = median(DJF), | ||
JJA = median(JJA), | ||
MAM = median(MAM), | ||
SON = median(SON), | ||
) | ||
|
||
worst_model = RMSEs(; | ||
model_name = "Worst", | ||
ANN = maximum(abs.(ANN)), | ||
DJF = maximum(abs.(DJF)), | ||
JJA = maximum(abs.(JJA)), | ||
MAM = maximum(abs.(MAM)), | ||
SON = maximum(abs.(SON)), | ||
) | ||
|
||
best_model = RMSEs(; | ||
model_name = "Best", | ||
ANN = minimum(abs.(ANN)), | ||
DJF = minimum(abs.(DJF)), | ||
JJA = minimum(abs.(JJA)), | ||
MAM = minimum(abs.(MAM)), | ||
SON = minimum(abs.(SON)), | ||
) | ||
|
||
(; best_single_model = best_single_model(vecRMSEs), median_model, worst_model, best_model) | ||
end | ||
|
||
COMPARISON_RMSEs["pr"] = RSME_stats(OTHER_MODELS_RMSEs["pr"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[precipitation_obs] | ||
git-tree-sha1 = "7486bf32e9352493f69364aead26f01eaf90d2af" | ||
|
||
[[precipitation_obs.download]] | ||
sha256 = "463ebc1886c4e0be9656656da699f2cbb87d7c2568d5e81277c0c8a415dc8143" | ||
url = "https://caltech.box.com/shared/static/j63uak557kw7tlzb3dgwifoaeczekzm4.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters