Skip to content

Commit

Permalink
Merge pull request #43 from epiforecasts/fix_cases
Browse files Browse the repository at this point in the history
added scores argument pass to cases
  • Loading branch information
seabbs authored Apr 18, 2020
2 parents b5d4b88 + df74a04 commit e365927
Show file tree
Hide file tree
Showing 30 changed files with 479 additions and 449 deletions.
12 changes: 9 additions & 3 deletions R/score_case_forecast.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' logs, bias, and sharpness as well as the forecast date and time horizon.
#' @export
#'
#' @inheritParams score_forecast
#' @importFrom dplyr rename
#' @examples
#' ## Fit a model (using a subset of observations)
Expand All @@ -21,13 +22,18 @@
#'
#' ## Score the model fit (with observations during the time horizon of the forecast)
#' score_case_forecast(pred_cases, EpiSoon::example_obs_cases)
score_case_forecast <- function(pred_cases, obs_cases) {
#'
#'
#' ## Score the model fit (with observations during the time horizon of the forecast)
#' score_case_forecast(pred_cases, EpiSoon::example_obs_cases, scores = c("crps", "sharpness", "bias"))
score_case_forecast <- function(pred_cases, obs_cases, scores = "all") {

pred_cases <- dplyr::rename(pred_cases, rt = cases)

obs_cases <- dplyr::rename( obs_cases, rt = cases)
obs_cases <- dplyr::rename(obs_cases, rt = cases)

scores <- EpiSoon::score_forecast(pred_cases, obs_cases)
scores <- EpiSoon::score_forecast(pred_cases, obs_cases,
scores = scores)

return(scores)
}
Expand Down
284 changes: 142 additions & 142 deletions docs/articles/introduction.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 20 additions & 20 deletions docs/reference/bsts_model.html

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

Binary file modified docs/reference/compare_models-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/compare_models-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/compare_timeseries-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/compare_timeseries-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e365927

Please sign in to comment.