Skip to content
Permalink
Browse files
Merge pull request #25 from reichlab/casey
update 0 prob bin check for hosp
  • Loading branch information
gcgibson committed Apr 24, 2020
2 parents 9548629 + 5ec5ec0 commit d4fb1ea6672b5754770916d95f615c352b073e02
Showing 3 changed files with 8 additions and 2 deletions.
@@ -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

@@ -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"),
@@ -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()

0 comments on commit d4fb1ea

Please sign in to comment.