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

Create documentation/vignette for the naming scheme of our functions #520

Open
nikosbosse opened this issue Nov 30, 2023 · 1 comment
Open
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@nikosbosse
Copy link
Contributor

nikosbosse commented Nov 30, 2023

Edit: Warning - this might be partly outdated.

We should aim for as much consistency as possible in naming things.

This issue summarises our current thinking and should eventually become a Vignette

Scoring rules

See #476 #610.

We call "scoring rule" any function that computes a score / metric / quantity of interest based on forecasts and observed values. We call "score" the output of a scoring rule.

"Scoring rule" usually means the specific R function that computes a score. We use sentences such as "you can pass a list of scoring rules to score(), or "you can call a scoring rule directly". And "scores are computed by scoring rules". Sometimes, "scoring rule" can also denote the function in a more abstract, mathematical sense. For example we would say "the absolute error is a scoring rule" or the "CRPS" is a proper scoring rule. Sometimes we use "rules" as short for "scoring rules", for example when naming function arguments.

In other contexts in the literature, "score" is also used as short for "scoring rule", for example in a sentence like "the CRPS is a proper score". We will avoid this terminology.

Scoring rules are consistently named in the following way:
<name of the scoring rule> + _ + <forecast type>

If there is only one forecast type for which a scoring rule is applicable, _ + <forecast type> is sometimes omitted.

get_-functions

  • functions with the prefix get_ are designed to provide additional information based on the data
  • they are usually called on the raw forecasts

Classes

We have one class for every forecast type

  • forecast_binary
  • forecast_point
  • forecast_sample
  • forecast_quantile

We have a class for the output of score():

  • score

Plotting functions

We briefly considered having classes solely for plotting (with the class named after the function). But then we decided to instead have dedicated plotting functions.

Plotting functions are named plot_ + name of function. If the function name has a prefix like get_, then that is replaced with plot_.
Examples: plot_forecast_counts, plot_correlation, plot_pairwise_comparion.

add_-functions

Functions with an add_ prefix add columns with additional information to their inputs.
add_pairwise_comparison()
add_coverage()
add_interval_range()

Internal input checks

check_, assert_, test_

  • assert_: Returns NULL invisibly if the assertion was successful and throws an error otherwise.
  • check_: Returns TRUE if the check was successful and a string with an error message otherwise
  • test_: Returns TRUE if the check was successful and FALSE otherwise
@seabbs
Copy link
Contributor

seabbs commented Feb 28, 2024

This feels a bit outdated and possibly complete? Potentially we need to clearly document somewhere what the current decisions are?

@nikosbosse nikosbosse changed the title Create a consistent scheme for naming functions and entities Create documentation/vignette for the naming scheme of our functions Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
Status: No status
Development

No branches or pull requests

2 participants