Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add counterfactual minus guided/unguided diff at location level #726

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Zapiano
Copy link
Collaborator

@Zapiano Zapiano commented Mar 22, 2024

Followed an approach similar to #452 (comment) but for a spatial level.

Note: Depends on #847

Example of code

using ADRIA
using WGLMakie, GeoMakie, GraphMakie

Makie.inline!(false)

# Load domain
dom = ADRIA.load_domain(...)

# Create scenarios
num_scens = 2^10
scens = ADRIA.sample(dom, num_scens)

# Run model / Load ResultSet
rs = ADRIA.run_scenarios(dom, scens, "45")

# Extract cf_difference_loc for guided and unguided (in that order)
rc = ADRIA.metrics.relative_cover(rs)
gd_res, ug_res = ADRIA.metrics.cf_difference_loc(rc, scens)

# Plot cf_difference_loc for unguided and guided
gd_fig = ADRIA.viz.diff_map(rs, gd_res[2, :])
ug_fig = ADRIA.viz.diff_map(rs, ug_res[2, :])

Plots

  • 1024 scenarios
Guided - Counterfactual Unguided - Counterfactual
gd_cf_diff_map ug_cf_diff_map

@ConnectedSystems
Copy link
Collaborator

Bump @Zapiano

@ConnectedSystems
Copy link
Collaborator

How close are we to merging this?

@Zapiano
Copy link
Collaborator Author

Zapiano commented Sep 13, 2024

How close are we to merging this?

I'll start looking into this now and let you know what's missing or of it's ready soon.

@Zapiano Zapiano marked this pull request as ready for review September 13, 2024 10:11
@Zapiano
Copy link
Collaborator Author

Zapiano commented Sep 13, 2024

@ConnectedSystems This one is ready for another review. Note that now it depends on #847

@Zapiano Zapiano force-pushed the loc-diff branch 3 times, most recently from da1db9d to 9ef5c30 Compare September 20, 2024 05:56
@ConnectedSystems
Copy link
Collaborator

ConnectedSystems commented Sep 21, 2024

Thanks.

An example usage would be appreciated too @Zapiano

@Zapiano
Copy link
Collaborator Author

Zapiano commented Sep 23, 2024

Thanks.

An example usage would be appreciated too @Zapiano

I've added an example in this PR. Once this PR is approved I can add this plot to the documentation on a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants