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

Fix readjustment of number of slices bug in RSA #679

Merged
merged 23 commits into from
Feb 14, 2024

Conversation

Rosejoycrocker
Copy link
Collaborator

Fixes readjustment of number of slices bug in RSA (partially addresses #615) and changes output of RSA to YAXArrays.Dataset type.

@ConnectedSystems
Copy link
Collaborator

Does the switch to YAXArray break the ability to plot results?
I don't see any compatibility layer in place.

@Rosejoycrocker
Copy link
Collaborator Author

Does the switch to YAXArray break the ability to plot results? I don't see any compatibility layer in place.

There are also changes to viz.rsa() in this PR so plotting works

@@ -1,7 +1,7 @@
using Makie, DataFrames

using ADRIA: ResultSet, metrics.metric_label, analysis.col_normalize, model_spec
using NamedDims, AxisKeys
using NamedDims, AxisKeys, YAXArrays, DimensionalData
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the import of DimensionalData simply to have the At method?

If so, I'd prefer it be imported via YAXArrays:

import YAXArrays.DD: At

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I just took this from the YAXArray docs and forgot to remove, I've removed it now

Comment on lines 9 to 10
YAXArrays,
DimensionalData
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with previous comment - if this is for At, import it directly.

@ConnectedSystems
Copy link
Collaborator

Does the switch to YAXArray break the ability to plot results? I don't see any compatibility layer in place.

There are also changes to viz.rsa() in this PR so plotting works

Thanks Rose, clearly I'm going blind.

@@ -175,7 +175,7 @@ Makie figure
function ADRIA.viz.rsa!(
g::Union{GridLayout,GridPosition},
rs::ResultSet,
si::NamedDimsArray,
si::YAXArrays.Dataset,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not import Dataset directly so prefacing it with YAXArrays is not necessary?

Or is there a different Dataset type that is causing a conflict?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've replaced with Dataset

Copy link
Collaborator

@ConnectedSystems ConnectedSystems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments for consideration

… storage size, but then S i readjusted according to the factor type
Add `factors` as input to specify which factors to output
Not max between number of categories and default S
Each entry has bins as first column, sensitivities as second
Also remove original Dict() storage for sensitivities
Values to be stored in YAXArrays with shared dimensions where relevant  (variables other than unordered categorical type)
Keys of NamedTuple are variable names
@Rosejoycrocker Rosejoycrocker force-pushed the fix-rsa-bug-in-slice-labels branch from 2ff9c61 to 3324de3 Compare February 13, 2024 06:21
@Rosejoycrocker
Copy link
Collaborator Author

Some minor comments for consideration

I think I've addressed your comments, If you're happy with this I'll do another PR with similar changes for outcome_map

@ConnectedSystems
Copy link
Collaborator

Busy with something else at the moment, would you mind attaching a figure here to demonstrate its working please?

@Rosejoycrocker
Copy link
Collaborator Author

Rosejoycrocker commented Feb 14, 2024

Busy with something else at the moment, would you mind attaching a figure here to demonstrate its working please?

Here's an example
sensitivity_rsa_ex

I'm not sure why there's the peak for guided and the number of corals, it's only 1024 runs

@ConnectedSystems
Copy link
Collaborator

The peak is telling you that there is high variability in that factor space.

In other words, the outcome assessed is highly sensitive to that region of factor space, which corresponds with no intervention.

@Rosejoycrocker
Copy link
Collaborator Author

The peak is telling you that there is high variability in that factor space.

In other words, the outcome assessed is highly sensitive to that region of factor space, which corresponds with no intervention.

Makes sense

Copy link
Collaborator

@ConnectedSystems ConnectedSystems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ConnectedSystems ConnectedSystems merged commit cfeee82 into main Feb 14, 2024
@ConnectedSystems ConnectedSystems deleted the fix-rsa-bug-in-slice-labels branch February 14, 2024 03:43
@DanTanAtAims DanTanAtAims mentioned this pull request Aug 1, 2024
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