Skip to content

Commit

Permalink
Merge pull request #548 from epiforecasts/test-metrics-point
Browse files Browse the repository at this point in the history
Issue 551: Remove scoringutils metrics as using Metrics versions
  • Loading branch information
nikosbosse authored Jan 5, 2024
2 parents e3bf253 + 10641d6 commit 52e2cb8
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 133 deletions.
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ S3method(validate_forecast,forecast_binary)
S3method(validate_forecast,forecast_point)
S3method(validate_forecast,forecast_quantile)
S3method(validate_forecast,forecast_sample)
export(abs_error)
export(add_coverage)
export(add_pairwise_comparison)
export(ae_median_quantile)
Expand Down Expand Up @@ -69,7 +68,6 @@ 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)
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ The update introduces breaking changes. If you want to keep using the older vers
- `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.
- `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`.
- 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.

# scoringutils 1.2.2
Expand Down
52 changes: 0 additions & 52 deletions R/metrics-point.R

This file was deleted.

2 changes: 1 addition & 1 deletion R/metrics-quantile.R
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ bias_quantile_single_vector <- function(observed, predicted, quantile, na.rm) {
#' `quantile`.
#' @inheritParams wis
#' @return numeric vector of length N with the absolute error of the median
#' @seealso [ae_median_sample()], [abs_error()]
#' @seealso [ae_median_sample()]
#' @importFrom stats median
#' @examples
#' observed <- rnorm(30, mean = 1:30)
Expand Down
3 changes: 1 addition & 2 deletions R/metrics-sample.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ bias_sample <- function(observed, predicted) {
#' the number of data points and N (number of columns) the number of Monte
#' Carlo samples. Alternatively, `predicted` can just be a vector of size n.
#' @return vector with the scoring values
#' @seealso [ae_median_quantile()], [abs_error()]
#' @seealso [ae_median_quantile()]
#' @importFrom stats median
#' @examples
#' observed <- rnorm(30, mean = 1:30)
Expand Down Expand Up @@ -127,7 +127,6 @@ ae_median_sample <- function(observed, predicted) {
#' the number of data points and N (number of columns) the number of Monte
#' Carlo samples. Alternatively, `predicted` can just be a vector of size n.
#' @return vector with the scoring values
#' @seealso [squared_error()]
#' @examples
#' observed <- rnorm(30, mean = 1:30)
#' predicted_values <- matrix(rnorm(30, mean = 1:30))
Expand Down
39 changes: 0 additions & 39 deletions man/abs_error.Rd

This file was deleted.

2 changes: 1 addition & 1 deletion man/ae_median_quantile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/ae_median_sample.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions man/se_mean_sample.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 0 additions & 31 deletions man/squared_error.Rd

This file was deleted.

0 comments on commit 52e2cb8

Please sign in to comment.