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

Develop into main #579

Merged
merged 417 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
417 commits
Select commit Hold shift + click to select a range
32239bf
Update documentation for `wis()` and its components
nikosbosse Nov 9, 2023
31271d3
Add new function, `interval_coverage_deviation_quantile()` - I know t…
nikosbosse Nov 10, 2023
9c9f286
Create a new helper function to compute ranges of central prediction …
nikosbosse Nov 10, 2023
b883dd8
Update `metrics_quantile`
nikosbosse Nov 10, 2023
7b62919
Small update to `metrics_quantile` + fixing a typo
nikosbosse Nov 10, 2023
c674764
update `ae_median_quantile()` and documentation associated to `wis()`…
nikosbosse Nov 10, 2023
27d4a78
add input checks to `ae_median_sample()` and `se_mean_sample()`
nikosbosse Nov 10, 2023
e2618cd
Update documentation for `metrics_quantile` and remove # no lint from…
nikosbosse Nov 10, 2023
2ef9a52
Correct error in ae_median_quantile, update data file and documentation
nikosbosse Nov 11, 2023
7e635eb
Correct an issue with `pit()` where this still relies on the computat…
nikosbosse Nov 11, 2023
77fcde4
commit previously forgotten change in `metrics_quantile`
nikosbosse Nov 11, 2023
295eb51
Fix issues with ae_median_sample(), ae_median_quantile() and se_mean_…
nikosbosse Nov 12, 2023
88fcdce
Change "interval_score" to "wis" as a metric name. Comment out code f…
nikosbosse Nov 12, 2023
337ea1f
Replace score.scoringutils_quantile() with new function
nikosbosse Nov 12, 2023
7e6dbe8
update available_metrics() to include wis and coverage_ values (this …
nikosbosse Nov 12, 2023
08dab31
Update vignette to update / comment out code that cannot be run anymore
nikosbosse Nov 12, 2023
f4d5d43
Fix test for ae_median_sample()
nikosbosse Nov 12, 2023
9607615
Update tests
nikosbosse Nov 12, 2023
c214ade
comment out / delete failing tests related to ranges in the output of…
nikosbosse Nov 12, 2023
71d6d65
Delete old version of `score.score_quantile()`
nikosbosse Nov 12, 2023
596dcee
improve the way that data.frames are split in `score()` to deal with …
nikosbosse Nov 12, 2023
6989f5d
Add test file for binary metrics and input checks
nikosbosse Nov 12, 2023
376de95
Remove comment (to be turned into an issue)
nikosbosse Nov 12, 2023
b13f00a
small fix in score.scoringutils_quantile to avoid a warning
nikosbosse Nov 12, 2023
983c030
move tests around so they better correspond to file names used for ac…
nikosbosse Nov 12, 2023
c89b1f5
fix small test issues
nikosbosse Nov 12, 2023
cd0d154
Add input checks for quantile-based forecasts
nikosbosse Nov 13, 2023
40807ad
remove old test for sharpness (test has been moved to test-metrics-sa…
nikosbosse Nov 13, 2023
fa3a7ab
move piece of code around within the metrics-quantile.R file (since m…
nikosbosse Nov 13, 2023
0d42acc
Add more tests for quantile metrics
nikosbosse Nov 13, 2023
32357f1
Rework existing `add_coverage()` function to work with raw forecasts
nikosbosse Nov 13, 2023
1be9055
Update News
nikosbosse Nov 13, 2023
8719dbe
Update `get_protetcted_columns()` with coverage columns
nikosbosse Nov 13, 2023
1252e13
Update `quantile_to_interval.data.frame()` to work with NA values
nikosbosse Nov 13, 2023
3af9fff
Don't remove NA values in `add_coverage()` anymore
nikosbosse Nov 13, 2023
02c4b1c
Update `add_coverage` to store an attribute `metric_names` with the n…
nikosbosse Nov 13, 2023
b41d655
Update tests and code snippets to get stuff working again that was pr…
nikosbosse Nov 13, 2023
79fc533
Automatic readme update
actions-user Nov 13, 2023
f7faff2
horrible, but working version of a refactoring of score.scoringutils_…
nikosbosse Nov 14, 2023
cb9bcbe
More elegant version, currently failing for sample-based forecasts be…
nikosbosse Nov 14, 2023
102370d
Fix score.scoringutils_sample by using matrices
nikosbosse Nov 14, 2023
004d2b8
move the expression into `apply_metrics()`
nikosbosse Nov 14, 2023
7eb7c96
Update metrics_quantile (improved error handling + getting rid of `ru…
nikosbosse Nov 14, 2023
6c213fc
Add global variable to fix failing test
nikosbosse Nov 14, 2023
9705994
Create function to ensure an object is a data.table
nikosbosse Nov 14, 2023
afdd3ac
Simplify set_forcast_unit and ensure that it operates on a data.table
nikosbosse Nov 14, 2023
218c01c
Make message in `check_columns_present` nicer
nikosbosse Nov 14, 2023
21d887a
Reintroduce `run_safely()` into `metrics_quantile` - the alternative …
nikosbosse Nov 14, 2023
ebe3869
correct `check_columns_present()`
nikosbosse Nov 14, 2023
ba9adbf
Update `set_forecast_unit()` and add tests
nikosbosse Nov 14, 2023
9ba205a
Merge pull request #377 from epiforecasts/rework-quantile-to-interval…
nikosbosse Nov 15, 2023
f5bb30b
Merge pull request #395 from epiforecasts/rework-score.quantile()
nikosbosse Nov 15, 2023
e76c4f5
Merge pull request #396 from epiforecasts/update-quantile-metrics
nikosbosse Nov 15, 2023
a9e89bb
Allow passing additional arguments to `wis()` from `overprediction()`…
nikosbosse Nov 15, 2023
be1f53c
Merge pull request #419 from epiforecasts/rework_ae_median
nikosbosse Nov 15, 2023
c6c2dfc
Merge pull request #421 from epiforecasts/rework-score.scoringutils_q…
nikosbosse Nov 15, 2023
3928002
Merge pull request #422 from epiforecasts/expand-tests
nikosbosse Nov 15, 2023
b45ec5a
Merge pull request #423 from epiforecasts/expand-tests2
nikosbosse Nov 15, 2023
e3fcec3
Merge pull request #426 from epiforecasts/reword-add_coverage2
nikosbosse Nov 15, 2023
cc72c53
Merge pull request #430 from epiforecasts/create-apply-metrics
nikosbosse Nov 15, 2023
6cb1c3e
Merge pull request #397 from epiforecasts/add-wis-components
nikosbosse Nov 15, 2023
ad411da
Merge pull request #437 from epiforecasts/fix-set_forecast_unit
nikosbosse Nov 15, 2023
8fe6e2e
Merge pull request #417 from epiforecasts/add-coverage-deviation
nikosbosse Nov 15, 2023
eb45cbb
Merge pull request #390 from epiforecasts/rework-add_coverage()
nikosbosse Nov 16, 2023
4df4576
Merge pull request #388 from epiforecasts/rework-quantile-scores
nikosbosse Nov 16, 2023
55320ca
Fix an issue with `correlation()` and the test for `plot_correlation()`
nikosbosse Nov 16, 2023
995b90b
Add a new function to check for matching dimensions in point forecast…
nikosbosse Nov 16, 2023
7e7f1cd
update and expand binary tests
nikosbosse Nov 16, 2023
26d4bbb
Add point input checks where they are very similar to binary input ch…
nikosbosse Nov 16, 2023
c33212e
Fix small typos in the check functions, update tests
nikosbosse Nov 17, 2023
36c7874
export get_forecast_unit
nikosbosse Nov 18, 2023
95a9386
Add tests for get_forecast_unit()
nikosbosse Nov 18, 2023
b0ef998
replace `remove_na_observed_predicted` with `get_complete_forecasts()`
nikosbosse Nov 18, 2023
16372f6
expose `get_forecast_type()` and add tests
nikosbosse Nov 18, 2023
9aa85d3
delete code remnants that shouldn't be there
nikosbosse Nov 18, 2023
dbd0a61
Merge pull request #478 from epiforecasts/fix-merge
nikosbosse Nov 19, 2023
59d6e9f
Merge pull request #479 from epiforecasts/fix-merge
nikosbosse Nov 19, 2023
4099d88
update pkgdown yaml file
nikosbosse Nov 19, 2023
8d769b1
Update keywords everywhere
nikosbosse Nov 19, 2023
1d7ce26
remove nested structure from pkgdown yaml as it made building the sit…
nikosbosse Nov 19, 2023
d043e24
Update docs for functions that now got a new keyword
nikosbosse Nov 19, 2023
32d8c2d
Update gh action and DESCRIPTION to use R >= 3.6
nikosbosse Nov 19, 2023
78a1a75
fix documentation
nikosbosse Nov 19, 2023
fbcf6f1
Replace |> with %>% in tests to prevent them from failing with R 3.6
nikosbosse Nov 20, 2023
8e3eaee
remove linebreaks at the end of the file
nikosbosse Nov 20, 2023
0268107
Merge pull request #483 from epiforecasts/fix-gh-action
nikosbosse Nov 20, 2023
88cfd97
Merge pull request #466 from epiforecasts/expose-function3
nikosbosse Nov 20, 2023
ee851ee
Merge branch 'develop' into expose-functions
nikosbosse Nov 20, 2023
1a730f4
Merge pull request #464 from epiforecasts/expose-functions
nikosbosse Nov 20, 2023
67768c5
Update docs to make them more consistent
nikosbosse Nov 20, 2023
b778f8a
Merge pull request #460 from epiforecasts/update-binary-input
nikosbosse Nov 20, 2023
bf1bbd5
Merge branch 'develop' into fix-pkgdown
nikosbosse Nov 20, 2023
2e8fbb8
Update more keywords to fix failing pkgdown
nikosbosse Nov 20, 2023
d641893
fix keyword
nikosbosse Nov 20, 2023
bbca6c0
Replace get_complete_forecasts() by na.omit()
nikosbosse Nov 20, 2023
0c26191
Merge branch 'develop' into expose-functions2
nikosbosse Nov 20, 2023
5f3c330
remove duplicate test which already exists elsewhere
nikosbosse Nov 21, 2023
8a3e02b
Update error message
nikosbosse Nov 21, 2023
dc030e2
update error message
nikosbosse Nov 21, 2023
f022891
Update documentation to make clear `na.omit()` is used
nikosbosse Nov 21, 2023
799a349
Add additional test to ensure that na.omit respects classes and attri…
nikosbosse Nov 21, 2023
9f90825
Add `na.omit` to scores, update NEWS.md
nikosbosse Nov 21, 2023
7a91b96
Don't na.omit in summarise_scores. This would require a much bigger c…
nikosbosse Nov 21, 2023
de70ac0
Update doc - removing random linebreak
nikosbosse Nov 21, 2023
64435a3
Update bias_quantile to only produce a message once
nikosbosse Nov 24, 2023
5f182da
move error message from `bias_quantile_single_vector()` to `bias_quan…
nikosbosse Nov 24, 2023
55e5744
Merge pull request #482 from epiforecasts/fix-pkgdown
nikosbosse Nov 27, 2023
a83add6
Update lintr to ignore files based on vignettes (these always result …
nikosbosse Nov 28, 2023
e4f8238
fix linting issues
nikosbosse Nov 28, 2023
2fbf9ab
Merge branch 'develop' into fix-linting
nikosbosse Nov 28, 2023
accb868
Merge pull request #501 from epiforecasts/improve-bias-quantile
nikosbosse Nov 28, 2023
b4ee467
Handle URL in data docs in a way that pkgdown doesn't complain
nikosbosse Nov 28, 2023
0848975
Delete old alias for `avail_forecasts()`
nikosbosse Nov 28, 2023
5b7aa12
remove `plot_avail_forecasts()`
nikosbosse Nov 28, 2023
8666a52
Replace `available_forecasts()` with `get_forecast_counts()`
nikosbosse Nov 28, 2023
1626fce
Update NEWS file
nikosbosse Nov 28, 2023
4ff6d58
Small correction in a previous news item
nikosbosse Nov 28, 2023
0b8a23d
Update News item
nikosbosse Nov 28, 2023
0cfb741
fix linting issues
nikosbosse Nov 28, 2023
e118103
apply suggestions made by @seabbs during code review to re-style code
nikosbosse Nov 28, 2023
4999d25
Rename `interval_coverage_deviation_quantile` to `interval_coverage_d…
nikosbosse Nov 28, 2023
d2844d3
Rename interval_coverage_deviation_quantile to interval_coverage_dev_…
nikosbosse Nov 28, 2023
c48d6dd
Rename class "forecast_count" to "prediction_count"
nikosbosse Nov 29, 2023
b54b9b9
Merge branch 'develop' into fix-linting
nikosbosse Nov 29, 2023
97d204f
Merge pull request #509 from epiforecasts/fix-linting
nikosbosse Nov 29, 2023
a450e1b
delete function code
nikosbosse Dec 5, 2023
18f42a8
Create `plot_forecast_counts()` to replace previous S3 method
nikosbosse Dec 5, 2023
8c65056
Update NEWS file
nikosbosse Dec 5, 2023
1463221
Add input checks to `plot_forecast_counts()`
nikosbosse Dec 6, 2023
edeeae7
Update arguments for `plot_forecast_counts()`
nikosbosse Dec 6, 2023
2365a22
Fix bug in logs_binary()
nikosbosse Dec 6, 2023
d761257
Remove function `remove_scoringutils_class()`
nikosbosse Dec 6, 2023
3a48fee
Delete bias_range() and remove interval_score from exported functions
nikosbosse Dec 6, 2023
38fe49a
Add news item
nikosbosse Dec 6, 2023
1af728e
Update examples
nikosbosse Dec 6, 2023
9bc405a
fix linting issue
nikosbosse Dec 6, 2023
ab36bae
Update examples
nikosbosse Dec 6, 2023
a7d12d1
remove the function `delete_columns()`
nikosbosse Dec 7, 2023
8275cdf
Merge pull request #525 from epiforecasts/drop-interval-functions
nikosbosse Dec 7, 2023
0fb4ca2
Merge pull request #524 from epiforecasts/fix-binary-rules
nikosbosse Dec 11, 2023
5c3a1f4
Merge pull request #529 from epiforecasts/remove-delete_columns
nikosbosse Dec 14, 2023
c11ce14
Merge pull request #511 from epiforecasts/rename-avail_forecasts
nikosbosse Dec 14, 2023
e15b2b7
Update documentation for `score()`
nikosbosse Dec 16, 2023
a2eb1dc
Replace `validate()` by `as_forecast()`
nikosbosse Dec 16, 2023
83a7540
Add trackdown folder to gitignore and buildignore
nikosbosse Dec 16, 2023
418ab68
Replace validate() with as_forecast()
nikosbosse Dec 16, 2023
94e84af
rename `validate()` to `validate_forecast()`
nikosbosse Dec 16, 2023
e3e5059
Make `as_forecast()` a generic
nikosbosse Dec 16, 2023
f25f987
Update readme
nikosbosse Dec 16, 2023
3551174
Automatic readme update
actions-user Dec 16, 2023
a90b389
remove duplication in readme
nikosbosse Dec 19, 2023
8c1a77e
Automatic readme update
actions-user Dec 19, 2023
b591a78
Update score() to avoid double checks
nikosbosse Dec 19, 2023
0b01113
Update vignette
nikosbosse Dec 19, 2023
712ea0c
Rename forecast classes to `forecast_*`
nikosbosse Dec 19, 2023
7905136
rename `new_scoringutils()` to `new_forecast()`
nikosbosse Dec 19, 2023
8683800
change new_scoringutils to new_forecast
nikosbosse Dec 19, 2023
f645e2e
Rename instances of "scoringutils_" to "forecast_" when constructing …
nikosbosse Dec 19, 2023
41fc23f
Update News.md
nikosbosse Dec 19, 2023
c961e4c
Add documentation and tests for apply_metrics
nikosbosse Nov 18, 2023
35bf18b
Make documentation for `apply_metrics` more consistent
nikosbosse Nov 20, 2023
d04a82c
Rename `apply_metrics()` to `apply_rules()`
nikosbosse Dec 19, 2023
07b9426
Create functions for default scoring rules
nikosbosse Jan 2, 2024
d952fe5
Update documentation for new functions
nikosbosse Jan 2, 2024
518353b
Switch to using functions instead of package data for default rules
nikosbosse Jan 2, 2024
83e37f9
Delete package data with default scoring rules
nikosbosse Jan 2, 2024
1bd191d
Update existing tests
nikosbosse Jan 2, 2024
9e810b9
Make sure that input to `select_rules` is a list
nikosbosse Jan 2, 2024
00c1e99
Add tests for default scoring rules
nikosbosse Jan 2, 2024
ea2d09f
Fix linting issues
nikosbosse Jan 2, 2024
d51a2fd
Update NEWS.md file
nikosbosse Jan 2, 2024
e78dfea
replace `\()` by `function()` so that code works with R versions <4
nikosbosse Jan 2, 2024
5efd52d
Merge branch 'develop' into expose-functions2
nikosbosse Jan 2, 2024
23e9255
fix merge conflict
nikosbosse Jan 2, 2024
0e649cc
Update failing tests
nikosbosse Jan 2, 2024
8b3d13b
throw a message if NA value are removed
nikosbosse Jan 2, 2024
c1bdf4b
switch order of message and error
nikosbosse Jan 2, 2024
81a1506
update tests to avoid random messages
nikosbosse Jan 2, 2024
0d96e56
Change "possibilities" to "rules" as function argument, require named…
nikosbosse Jan 2, 2024
2253c6b
fix error checking for named input
nikosbosse Jan 2, 2024
28213bd
fix failing test
nikosbosse Jan 2, 2024
a0f23ed
Merge pull request #465 from epiforecasts/expose-functions2
nikosbosse Jan 3, 2024
97cca59
Export `select_rules()` to users
nikosbosse Jan 3, 2024
9240ba7
Change function default from `select = "all"` to `select = NULL`
nikosbosse Jan 3, 2024
12c69b5
Update argument to `select = NULL`
nikosbosse Jan 3, 2024
b29223a
Update function documentation and pkgdown keywords
nikosbosse Jan 3, 2024
c71f1ba
Update function documentation
nikosbosse Jan 3, 2024
cf59af6
Update tests to reflect the change to `select = NULL` in `select_rule…
nikosbosse Jan 3, 2024
890ab29
Update failing test
nikosbosse Jan 3, 2024
afb8a39
Omit `NA` values when checking the number of samples / quantiles per …
nikosbosse Jan 3, 2024
c811d55
Merge pull request #536 from epiforecasts/make-rules-function
nikosbosse Jan 3, 2024
83c762e
Add examples back in for interval plots and quantile plots previously…
nikosbosse Nov 18, 2023
c86feb7
Update example
nikosbosse Jan 3, 2024
67257e5
remove forecast_unit, forecast_type and warnings attribute in `valida…
nikosbosse Jan 3, 2024
af0f6e4
remove `check_conflict` option from `get_forecast_unit()`, update NAM…
nikosbosse Jan 3, 2024
15a9909
remove check_conflict argument
nikosbosse Jan 3, 2024
5c7bdb9
Update NAMESPACE imports and documentation
nikosbosse Jan 3, 2024
1799834
Replace instances of "coverage" with either "interval coverage" or "q…
nikosbosse Jan 3, 2024
f945705
Fix linting issues
nikosbosse Jan 3, 2024
93b849a
rename coverage to interval_coverage or quantile_coverage
nikosbosse Jan 3, 2024
2ff165f
Update tests
nikosbosse Jan 3, 2024
9d23f66
remove scoringutils metrics as using Metrics versions
seabbs Jan 5, 2024
56eb662
add NEWs item
seabbs Jan 5, 2024
00b703e
remove metrics from see also doc links
seabbs Jan 5, 2024
8c35bec
catch final abs_error mention
seabbs Jan 5, 2024
e43e008
fix warning message
nikosbosse Jan 5, 2024
61bab0c
add a test for interval_coverage_quantile to catch insufficent quanti…
seabbs Jan 5, 2024
d4f779e
update interval_coverage_quantile to test the new warning message
seabbs Jan 5, 2024
8a9915a
make interval_coverage_dev_quantile part of mainline tests (i.e. drop…
seabbs Jan 5, 2024
866c9d0
Revert "make interval_coverage_dev_quantile part of mainline tests (i…
seabbs Jan 5, 2024
060eaee
add a test for interval_coverage_dev_quantile
seabbs Jan 5, 2024
4fe7a4a
add news item
seabbs Jan 5, 2024
85733bf
ping CI
seabbs Jan 5, 2024
9871994
Fix merge conflicts
nikosbosse Jan 5, 2024
6cab635
Automatic readme update
actions-user Jan 5, 2024
545b40c
Merge pull request #556 from epiforecasts/merge-main
nikosbosse Jan 5, 2024
520785d
Merge branch 'develop' into test-metrics-quantile
nikosbosse Jan 5, 2024
e3bf253
Merge pull request #554 from epiforecasts/test-metrics-quantile
nikosbosse Jan 5, 2024
10641d6
Merge branch 'develop' into test-metrics-point
nikosbosse Jan 5, 2024
52e2cb8
Merge pull request #548 from epiforecasts/test-metrics-point
nikosbosse Jan 5, 2024
14774eb
Create development version
actions-user Jan 5, 2024
3162729
Add version note
actions-user Jan 5, 2024
70a4eaa
Add NEWS item
actions-user Jan 5, 2024
fde164d
Trigger README render on change to DESCRIPTION
actions-user Jan 5, 2024
8796b9f
Rephrase to avoid CRAN/GitHub
actions-user Jan 5, 2024
2090e0a
Automatic readme update
actions-user Jan 5, 2024
cc41a0e
remove interval_coverage_sample
seabbs Jan 5, 2024
eaf8021
rename interval_coverage_quantle -> interval_coverage
seabbs Jan 5, 2024
c77dc6a
rename interval_coverage_deviation_quantile -> interval_coverage_devi…
seabbs Jan 5, 2024
20fb0d5
update documentation
seabbs Jan 5, 2024
11514b5
update news
seabbs Jan 5, 2024
4ca133c
reorder news
seabbs Jan 5, 2024
62b5dd3
fix newly introduced tests
seabbs Jan 5, 2024
8afcbec
Merge pull request #558 from epiforecasts/issue555
nikosbosse Jan 5, 2024
e01450f
add man/figures to git add
seabbs Jan 5, 2024
8f51de8
update package description in README
sbfnk Jan 5, 2024
a313ccc
add missing new line
sbfnk Jan 5, 2024
88e7b45
add dependabot to keep GHA up-to-date
sbfnk Jan 5, 2024
1a89300
Merge pull request #565 from epiforecasts/dependabot-actions
nikosbosse Jan 5, 2024
ee3120b
add transformation paper
sbfnk Jan 5, 2024
e5a4a77
Automatic readme update
actions-user Jan 5, 2024
67163a4
Merge pull request #563 from epiforecasts/readme-package-desc
nikosbosse Jan 5, 2024
0e84140
Automatic readme update
actions-user Jan 5, 2024
7004d8e
copy render readme action from epinowcast
nikosbosse Dec 20, 2023
fd5b1e5
don't clean upon pkgdown deployment
sbfnk Jan 5, 2024
15fce2b
This commit fixes issue 557: Small numerical issue in sample_to_quant…
jhellewell14 Jan 5, 2024
0b6853f
Added a unit test that checks that interval_coverage_deviation (the m…
jhellewell14 Jan 5, 2024
ea7d941
fix typo
sbfnk Jan 5, 2024
443f2a6
Automatic readme update [ci skip]
actions-user Jan 5, 2024
61905cf
Merge branch 'main' into develop
sbfnk Jan 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
^Meta$
^_pkgdown\.yml$
^inst/manuscript/manuscript_cache$
^inst/manuscript/.trackdown$
^\.lintr$
^docs$
^\.devcontainer$
Expand Down
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
1 change: 1 addition & 0 deletions .github/workflows/render_readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
push:
paths:
- 'README.Rmd'
- DESCRIPTION

jobs:
render-readme:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ doc
Meta
inst/manuscript/manuscript_cache/
inst/manuscript/manuscript.log
inst/manuscript/manuscript.aux
inst/manuscript/manuscript.blg
inst/manuscript/manuscript.pdf
inst/manuscript/manuscript.tex
inst/manuscript/manuscript_files/
inst/manuscript/.trackdown
docs
..bfg-report/
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ linters: linters_with_tags(
exclusions: c(
list.files("tests", recursive = TRUE, full.names = TRUE),
list.files("inst", recursive = TRUE, full.names = TRUE),
"vignettes/metric-details.Rmd"
list.files("vignettes", pattern = ".R$", full.names = TRUE)
)
exclude: "# nolint"
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: scoringutils
Title: Utilities for Scoring and Assessing Predictions
Version: 1.2.2
Version: 1.2.2.9000
Language: en-GB
Authors@R: c(
person(given = "Nikos",
Expand Down Expand Up @@ -47,11 +47,13 @@ License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Imports:
checkmate,
data.table,
ggdist (>= 3.2.0),
ggplot2 (>= 3.4.0),
lifecycle,
methods,
Metrics,
rlang,
scoringRules,
stats
Expand Down
72 changes: 63 additions & 9 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,34 +1,51 @@
# Generated by roxygen2: do not edit by hand

S3method(as_forecast,default)
S3method(print,scoringutils_check)
export(abs_error)
S3method(quantile_to_interval,data.frame)
S3method(quantile_to_interval,numeric)
S3method(score,default)
S3method(score,forecast_binary)
S3method(score,forecast_point)
S3method(score,forecast_quantile)
S3method(score,forecast_sample)
S3method(validate_forecast,forecast_binary)
S3method(validate_forecast,forecast_point)
S3method(validate_forecast,forecast_quantile)
S3method(validate_forecast,forecast_sample)
export(add_coverage)
export(add_pairwise_comparison)
export(ae_median_quantile)
export(ae_median_sample)
export(avail_forecasts)
export(as_forecast)
export(available_metrics)
export(bias_quantile)
export(bias_range)
export(bias_sample)
export(brier_score)
export(check_forecasts)
export(correlation)
export(crps_sample)
export(dispersion)
export(dss_sample)
export(find_duplicates)
export(interval_score)
export(get_duplicate_forecasts)
export(get_forecast_counts)
export(get_forecast_type)
export(get_forecast_unit)
export(interval_coverage)
export(interval_coverage_deviation)
export(log_shift)
export(logs_binary)
export(logs_sample)
export(mad_sample)
export(make_NA)
export(make_na)
export(merge_pred_and_obs)
export(new_forecast)
export(overprediction)
export(pairwise_comparison)
export(pit)
export(pit_sample)
export(plot_avail_forecasts)
export(plot_correlation)
export(plot_forecast_counts)
export(plot_heatmap)
export(plot_interval_coverage)
export(plot_pairwise_comparison)
Expand All @@ -39,15 +56,49 @@ export(plot_ranges)
export(plot_score_table)
export(plot_wis)
export(quantile_score)
export(quantile_to_interval)
export(rules_binary)
export(rules_point)
export(rules_quantile)
export(rules_sample)
export(run_safely)
export(sample_to_quantile)
export(score)
export(se_mean_sample)
export(select_rules)
export(set_forecast_unit)
export(squared_error)
export(summarise_scores)
export(summarize_scores)
export(theme_scoringutils)
export(transform_forecasts)
export(underprediction)
export(validate_forecast)
export(validate_general)
export(wis)
importFrom(Metrics,ae)
importFrom(Metrics,ape)
importFrom(Metrics,se)
importFrom(checkmate,assert)
importFrom(checkmate,assert_character)
importFrom(checkmate,assert_data_frame)
importFrom(checkmate,assert_data_table)
importFrom(checkmate,assert_factor)
importFrom(checkmate,assert_list)
importFrom(checkmate,assert_logical)
importFrom(checkmate,assert_number)
importFrom(checkmate,assert_numeric)
importFrom(checkmate,assert_string)
importFrom(checkmate,assert_subset)
importFrom(checkmate,assert_vector)
importFrom(checkmate,check_atomic_vector)
importFrom(checkmate,check_data_frame)
importFrom(checkmate,check_function)
importFrom(checkmate,check_matrix)
importFrom(checkmate,check_numeric)
importFrom(checkmate,check_vector)
importFrom(checkmate,test_factor)
importFrom(checkmate,test_list)
importFrom(checkmate,test_numeric)
importFrom(data.table,"%like%")
importFrom(data.table,':=')
importFrom(data.table,.I)
Expand All @@ -59,8 +110,11 @@ importFrom(data.table,data.table)
importFrom(data.table,dcast)
importFrom(data.table,is.data.table)
importFrom(data.table,melt)
importFrom(data.table,nafill)
importFrom(data.table,rbindlist)
importFrom(data.table,setDT)
importFrom(data.table,setattr)
importFrom(data.table,setcolorder)
importFrom(data.table,setnames)
importFrom(ggdist,geom_lineribbon)
importFrom(ggplot2,.data)
Expand Down Expand Up @@ -103,7 +157,6 @@ importFrom(ggplot2,xlab)
importFrom(ggplot2,ylab)
importFrom(lifecycle,deprecated)
importFrom(methods,hasArg)
importFrom(methods,is)
importFrom(rlang,enexprs)
importFrom(rlang,warn)
importFrom(scoringRules,crps_sample)
Expand All @@ -121,5 +174,6 @@ importFrom(stats,rbinom)
importFrom(stats,reorder)
importFrom(stats,runif)
importFrom(stats,sd)
importFrom(stats,weighted.mean)
importFrom(stats,wilcox.test)
importFrom(utils,combn)
47 changes: 46 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
# scoringutils 1.2.2.9000

This major update and addresses a variety of comments made by reviewers from the Journal of Statistical Software (see preprint of the manuscript [here](https://arxiv.org/abs/2205.07090)).

The update introduces breaking changes. If you want to keep using the older version, you can download it using `remotes::install_github("epiforecasts/[email protected]")`.

## Package updates
- In `score()`, required columns "true_value" and "prediction" were renamed and replaced by required columns "observed" and "predicted". Scoring functions now also use the function arguments "observed" and "predicted" everywhere consistently.
- The overall scoring workflow was updated. `score()` is now a generic function that dispatches the correct method based on the forecast type. forecast types currently supported are "binary", "point", "sample" and "quantile" with corresponding classes "forecast_binary", "forecast_point", "forecast_sample" and "forecast_quantile". An object of class `forecast_*` can be created using the function `as_forecast()`, which also replaces the previous function `check_forecasts()` (see more information below).
- Scoring rules (functions used for scoring) received a consistent interface and input checks:
- Scoring rules for binary forecasts:
- `observed`: factor with exactly 2 levels
- `predicted`: numeric, vector with probabilities
- Scoring rules for point forecasts:
- `observed`: numeric vector
- `predicted`: numeric vector
- Scoring rules for sample-based forecasts:
- `observed`: numeric, either a scalar or a vector
- `predicted`: numeric, a vector (if `observed` is a scalar) or a matrix (if `observed` is a vector)
- Scoring rules for quantile-based forecasts:
- `observed`: numeric, either a scalar or a vector
- `predicted`: numeric, a vector (if `observed` is a scalar) or a matrix (if `observed` is a vector)
- `quantile`: numeric, a vector with quantile-levels. Can alternatively be a matrix of the same shape as `predicted`.
- Users can now supply their own scoring rules to `score()` as a list of functions. Default scoring rules can be accessed using the functions `rules_point()`, `rules_sample()`, `rules_quantile()` and `rules_binary()`, which return a list of scoring rules suitable for the respective forecast type.
- `check_forecasts()` was replaced by a different workflow. There now is a function, `as_forecast()`, that determines forecast type of the data, constructs a forecasting object and validates it using the function `validate_forecast()` (a generic that dispatches the correct method based on the forecast type). Objects of class `forecast_binary`, `forecast_point`, `forecast_sample` and `forecast_quantile` have print methods that fulfill the functionality of `check_forecasts()`.
- The functionality for computing pairwise comparisons was now split from `summarise_scores()`. Instead of doing pairwise comparisons as part of summarising scores, a new function, `add_pairwise_comparison()`, was introduced that takes summarised scores as an input and adds pairwise comparisons to it.
- `add_coverage()` was reworked completely. It's new purpose is now to add coverage information to the raw forecast data (essentially fulfilling some of the functionality that was previously covered by `score_quantile()`)
- Support for the interval format was mostly dropped (see PR #525 by @nikosbosse and reviewed by @seabbs)
- The function `bias_range()` was removed (users should now use `bias_quantile()` instead)
- The function `interval_score()` was made an internal function rather than being exported to users. We recommend using `wis()` instead.
- The function `find_duplicates()` was renamed to `get_duplicate_forecasts()`
- Changes to `avail_forecasts()` and `plot_avail_forecasts()`:
- The function `avail_forecasts()` was renamed to `get_forecast_counts()`. This represents a change in the naming convention where we aim to name functions that provide the user with additional useful information about the data with a prefix "get_". Sees Issue #403 and #521 and PR #511 by @nikosbosse and reviewed by @seabbs for details.
- For clarity, the output column in `get_forecast_counts()` was renamed from "Number forecasts" to "count".
- `get_forecast_counts()` now also displays combinations where there are 0 forecasts, instead of silently dropping corresponding rows.
- `plot_avail_forecasts()` was renamed `plot_forecast_counts()` in line with the change in the function name. The `x` argument no longer has a default value, as the value will depend on the data provided by the user.
- The deprecated `..density..` was replaced with `after_stat(density)` in ggplot calls.
- Files ending in ".Rda" were renamed to ".rds" where appropriate when used together with `saveRDS()` or `readRDS()`.
- `score()` now calls `na.omit()` on the data, instead of only removing rows with missing values in the columns `observed` and `predicted`. This is because `NA` values in other columns can also mess up e.g. grouping of forecasts according to the unit of a single forecast.
- added documentation for the return value of `summarise_scores()`.
- Removed abs_error and squared_error from the package in favour of `Metrics::ae` and `Metrics::se`.
- Renamed `interval_coverage_quantile()` and `interval_coverage_dev_quantile()` to `interval_coverage()` and `interval_coverage_deviation()`, respectively. Removed `interval_coverage_sample()` as users are now expected to convert to a quantile format first before scoring.
- Added unit tests for `interval_coverage_quantile()` and `interval_coverage_dev_quantile()` in order to make sure that the functions provide the correct warnings when insufficient quantiles are provided.
- Documentation pkgdown pages are now created both for the stable and dev versions.

# scoringutils 1.2.2

## Package updates
Expand All @@ -6,7 +51,7 @@

## Bug fixes
- Fixes a bug with `set_forecast_unit()` where the function only workded with a data.table, but not a data.frame as an input.
- The metrics table in the vignette [Details on the metrics implemented in `scoringutils`](https://epiforecasts.io/scoringutils/articles/metric-details.html) had duplicated entries. This was fixed by removing the duplicated rows.
- The metrics table in the vignette [Details on the metrics implemented in `scoringutils`](https://epiforecasts.io/scoringutils/articles/metric-details.html) had duplicated entries. This was fixed by removing the duplicated rows.

# scoringutils 1.2.1

Expand Down
83 changes: 83 additions & 0 deletions R/add_coverage.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#' @title Add Coverage Values to Quantile-Based Forecasts
#'
#' @description Adds interval coverage of central prediction intervals,
#' quantile coverage for predictive quantiles, as well as the deviation between
#' desired and actual coverage to a data.table. Forecasts should be in a
#' quantile format (following the input requirements of `score()`).
#'
#' **Interval coverage**
#'
#' Interval coverage for a given interval range is defined as the proportion of
#' observations that fall within the corresponding central prediction intervals.
#' Central prediction intervals are symmetric around the median and and formed
#' by two quantiles that denote the lower and upper bound. For example, the 50%
#' central prediction interval is the interval between the 0.25 and 0.75
#' quantiles of the predictive distribution.
#'
#' The function `add_coverage()` computes the coverage per central prediction
#' interval, so the interval coverage will always be either `TRUE`
#' (observed value falls within the interval) or `FALSE` (observed value falls
#' outside the interval). You can summarise the interval coverage values to get
#' the proportion of observations that fall within the central prediction
#' intervals.
#'
#' **Quantile coverage**
#'
#' Quantile coverage for a given quantile is defined as the proportion of
#' observed values that are smaller than the corresponding predictive quantile.
#' For example, the 0.5 quantile coverage is the proportion of observed values
#' that are smaller than the 0.5 quantile of the predictive distribution.
#' Just as above, for a single observation and the quantile of a single
#' predictive distribution, the value will either be `TRUE` or `FALSE`.
#'
#' **Coverage deviation**
#'
#' The coverage deviation is the difference between the desired coverage
#' (can be either interval or quantile coverage) and the
#' actual coverage. For example, if the desired coverage is 90% and the actual
#' coverage is 80%, the coverage deviation is -0.1.
#'
#' @inheritParams score
#' @return a data.table with the input and columns "interval_coverage",
#' "interval_coverage_deviation", "quantile_coverage",
#' "quantile_coverage_deviation" added.
#' @importFrom data.table setcolorder
#' @examples
#' library(magrittr) # pipe operator
#' example_quantile %>%
#' add_coverage()
#' @export
#' @keywords scoring
#' @export
add_coverage <- function(data) {
stored_attributes <- get_scoringutils_attributes(data)
data <- as_forecast(data)
forecast_unit <- get_forecast_unit(data)
data_cols <- colnames(data) # store so we can reset column order later

interval_data <- quantile_to_interval(data, format = "wide")
interval_data[,
interval_coverage := (observed <= upper) & (observed >= lower)
][, c("lower", "upper", "observed") := NULL]

data[, range := get_range_from_quantile(quantile)]

data <- merge(interval_data, data, by = unique(c(forecast_unit, "range")))
data[, interval_coverage_deviation := interval_coverage - range / 100]
data[, quantile_coverage := observed <= predicted]
data[, quantile_coverage_deviation := quantile_coverage - quantile]

# reset column order
new_metrics <- c("interval_coverage", "interval_coverage_deviation",
"quantile_coverage", "quantile_coverage_deviation")
setcolorder(data, unique(c(data_cols, "range", new_metrics)))

# add coverage "metrics" to list of stored metrics
# this makes it possible to use `summarise_scores()` later on
stored_attributes[["metric_names"]] <- c(
stored_attributes[["metric_names"]],
new_metrics
)
data <- assign_attributes(data, stored_attributes)
return(data[])
}
Loading
Loading