Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from reichlab/casey
Browse files Browse the repository at this point in the history
update 0 prob bin check for hosp
  • Loading branch information
gcgibson authored Apr 24, 2020
2 parents 9548629 + 5ec5ec0 commit d4fb1ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ChangeLog file for cdcForecatUtils
0.1.9.6 - Zero prob bin fix for Hospitalization challenge

0.1.9.0 - Hospitalization challenge functionality added to verify

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: cdcForecastUtils
Type: Package
Title: Utility functions for CDC forecasts
Version: 0.1.9.5
Version: 0.1.9.6
Date: 2020-03-20
Authors@R: c(person("Nutcha", "Wattanachit", email = "nwattanachit@umass.edu", role = c("aut", "cre")),
person("Graham Casey", "Gibson", email = "gcgibson@umass.edu", role = "aut"),
Expand Down
7 changes: 6 additions & 1 deletion R/verify_bins.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ verify_bins <- function(entry, challenge = "ilinet") {
for(i in seq_along(entry_targets)) {
entry_bins <- unique(entry$bin[entry$target == entry_targets[i]])

if (challenge == "hopsitalization" & grepl("wk ahead",entry_targets[i] )){
entry_bins <- round(as.numeric(entry_bins))

}

valid_bins <- as.character(unique(valid$bin[valid$target == entry_targets[i]]))

missing_bins <- setdiff(valid_bins, entry_bins)
extra_bins <- setdiff(entry_bins, valid_bins)

if (challenge == "hospitalization"){
missing_bins <- missing_bins[!is.na(missing_bins)]
missing_bins <- c()# missing_bins[!is.na(missing_bins)]
}
if (challenge == "hospitalization" & all(is.na(entry_bins))){
missing_bins <-c()
Expand Down

0 comments on commit d4fb1ea

Please sign in to comment.