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

Implement basic scoring as part of inference #401

Conversation

SamuelBrand1
Copy link
Collaborator

This PR offers basic CRPS scoring as part of the inference process without outsourcing to scoringutils. The advantage of this approach is that we can run it without an RCall dependency.

The target time-varying processes for scoring are:

  • incidence
  • log incidence
  • cases
  • log cases
  • Exponential growth rate
  • Reproduction number
  • log Reproduction number

The relative time (relative to start of inference period) and the scores at each time point are now contained within the dictionary that is returned by inference configuration. The reference time (i.e. the data horizon for inference) is already recorded there.

Upsides: This is a light-weight approach that matches our current pattern of analysis. If we become storage limited in terms of saving all model samples for all model configurations this becomes useful rather than multiple calls to RCall and having to set up RCall in our compute environment.

Downsides: We miss out on the full functionality of scoringutils. However, if we aren't storage limited the saved inference outputs still allow us to return to using scoringutils.

Closes #391

Minor changes

  • Updated the returned values from truth data to align with latest version of EpiAware.
  • Modified the pipeline type to include a prefix field, which turns out to be useful compared to previous approach fully dependent on type dispatch.

Copy link
Contributor

Try this Pull Request!

Open Julia and type:

import Pkg
Pkg.activate(temp=true)
Pkg.add(url="https://github.com/CDCgov/Rt-without-renewal", rev="391-decide-and-implement-whether-to-do-scoring-as-post-processing-or-pre-saving-fit-objects", subdir="EpiAware")
using EpiAware

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.57%. Comparing base (900ff01) to head (7cfeead).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #401   +/-   ##
=======================================
  Coverage   93.57%   93.57%           
=======================================
  Files          54       54           
  Lines         560      560           
=======================================
  Hits          524      524           
  Misses         36       36           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@seabbs seabbs left a comment

Choose a reason for hiding this comment

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

LGTM. Critically CRPS implementation looks/is correct

@seabbs
Copy link
Collaborator

seabbs commented Jul 25, 2024

h that matches our current pattern of analysis.

The other downside is what if we want to consider any other metric aside from CRPS/want CRPS decomposition. Following this pattern we need to implement ourselves.

@seabbs
Copy link
Collaborator

seabbs commented Jul 25, 2024

I'm a little unclear as to the precise motivation for this PR (as we don't know if we are storage limited) but now its here we might as well use!

@seabbs seabbs added this pull request to the merge queue Jul 25, 2024
Merged via the queue into main with commit 2b816a8 Jul 25, 2024
11 checks passed
@seabbs seabbs deleted the 391-decide-and-implement-whether-to-do-scoring-as-post-processing-or-pre-saving-fit-objects branch July 25, 2024 19:45
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.

Decide and implement whether to do scoring as post-processing or pre-saving fit objects.
3 participants