8000 Add quantile interval score by reza-armuei · Pull Request #704 · nci/scores · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add quantile interval score #704

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

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

reza-armuei
Copy link
Collaborator
@reza-armuei reza-armuei commented Sep 27, 2024

Please work through the following checklists. Delete anything that isn't relevant.

Development for new xarray-based metrics

  • Works with n-dimensional data and includes reduce_dims, preserve_dims, and weights args.
  • Typehints added
  • Docstrings complete and followed Napoleon (google) style
  • Reference to paper/webpage is in docstring
  • Add error handling
  • Imported into the API

Testing of new xarray-based metrics

  • 100% unit test coverage
  • Test that metric is compatible with dask.
  • Test that metrics work with inputs that contain NaNs
  • Test that broadcasting with xarray works
  • Test both reduce and preserve dims arguments work
  • Test that errors are raised as expected
  • Test that it works with both xr.Dataarrays and xr.Datasets

Tutorial notebook

  • Short introduction to why you would use that metric and what it tells you
  • A link to a reference
  • A "things to try next" section at the end
  • Add notebook to Tutorial_Gallery.ipynb
  • Optional - a detailed discussion of how the metric works at the end of the notebook

Documentation

Copy link
Collaborator
@Steph-Chong Steph-Chong left a comment

Choose a reason for hiding this comment

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

@reza-armuei - I mostly help out with documentation. Just a heads up that I often do my reviews in a few rounds, so may do another round(s) of review later.

I have made some comments about some really minor things I noticed.

I also have two questions. In included.md, you say "Quantile Interval Score" is also known as "Interval Score". Given that:

  1. Should there be an additional entry for "Interval Score" in included.md?
  2. Should "Interval Score" also be its own function that calls scores.continuous.quantile_interval_score (e.g. similar to some of the categorical metrics which are known by multiple names)? I don't have an opinion on this, I just wanted to raise the question for consideration.

@tennlee
Copy link
Collaborator
tennlee commented Sep 29, 2024

I haven’t had a chance to review your pull request in full as yet. However, in the meantime I wanted to mention a few things.

API Docstring:

Over time we have refined what we think makes a good API docstring, and have started including more things in the API docstrings.

In your API docstring, it would be great if you could please add:


  • Mathjax

  • An example (or examples)

  • If relevant: a “See also:” section, where you mention any closely related functions

I don’t have an API docstring template (it is currently being drafted). However, here are two recent API docstrings that could be useful to look at:

https://scores.readthedocs.io/en/228-documentation-testing-branch/api.html#scores.continuous.kge

https://scores.readthedocs.io/en/latest/api.html#scores.probability.interval_tw_crps_for_ensemble (noting this one does not include mathjax)

Interval Score

I haven’t had a chance to look into this yet. But if quantile interval score is often referred to as interval score, it may well make sense to have a separate “interval score” function that calls “quantile interval score.”

However, before creating this additional function, I would suggest updating the existing docstring first. Then once that is sorted out, add the additional “interval score” function if required

Copy link
Collaborator
@DerynGriffiths DerynGriffiths left a comment

Choose a reason for hiding this comment

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

Hi @reza-armuei. I don't have the time or interest to do a full code review. I have made one suggestion for the doc string. If the code matches that in Jive then you can be pretty confident it is OK. If there are specific queries for me, feel free to contact me with them.
PS I see there is a tutorial notebook. I will have a look at that.

Copy link
Collaborator
@DerynGriffiths DerynGriffiths left a comment

Choose a reason for hiding this comment

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

I didn't find an easy way to run the notebook. The comments are all "for your consideration". Hopefully there is something useful for you.

@tennlee
Copy link
Collaborator
tennlee commented Oct 7, 2024

@reza-armuei please add the new tutorial notebook to the tutorial gallery. I have some feedback on the notebook itself as well, but I'll do that as a PR back to your fork.

@reza-armuei
Copy link
Collaborator Author

@reza-armuei please add the new tutorial notebook to the tutorial gallery. I have some feedback on the notebook itself as well, but I'll do that as a PR back to your fork.

Hi @tennlee I've already added [Tutorial](project:./tutorials/Quantile_Interval_And_Interval_Scores.md) to the included.md for interval_score and quantile_interval_score, do I need to add this tutorial to any other docs?

@tennlee
Copy link
Collaborator
tennlee commented Oct 8, 2024

@reza-armuei please add the new tutorial notebook to the tutorial gallery. I have some feedback on the notebook itself as well, but I'll do that as a PR back to your fork.

Hi @tennlee I've already added [Tutorial](project:./tutorials/Quantile_Interval_And_Interval_Scores.md) to the included.md for interval_score and quantile_interval_score, do I need to add this tutorial to any other docs?

Yes, you need to open up the Jupyter Notebook called "Tutorial Gallery" and add a link to your new notebook in there

Added quantile interval score

Fixed tutorial notebook

Addressed review comments

Revised a test based on review comment

Updated docstring

Updated tutorial gallery notebook
@reza-armuei reza-armuei force-pushed the add_quantile_interval_score branch from 53df404 to f895fa8 Compare October 8, 2024 01:59
@tennlee tennlee merged commit 84cd493 into nci:develop Oct 18, 2024
11 checks passed
@tennlee
Copy link
Collaborator
tennlee commented Oct 18, 2024

I have created #711 to track the goal of supporting Dataset arguments also.

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.

4 participants
0