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

Commit d4fb1ea

Browse files
authored
Merge pull request #25 from reichlab/casey
update 0 prob bin check for hosp
2 parents 9548629 + 5ec5ec0 commit d4fb1ea

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ChangeLog file for cdcForecatUtils
2+
0.1.9.6 - Zero prob bin fix for Hospitalization challenge
23

34
0.1.9.0 - Hospitalization challenge functionality added to verify
45

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: cdcForecastUtils
22
Type: Package
33
Title: Utility functions for CDC forecasts
4-
Version: 0.1.9.5
4+
Version: 0.1.9.6
55
Date: 2020-03-20
66
Authors@R: c(person("Nutcha", "Wattanachit", email = "nwattanachit@umass.edu", role = c("aut", "cre")),
77
person("Graham Casey", "Gibson", email = "gcgibson@umass.edu", role = "aut"),

R/verify_bins.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,18 @@ verify_bins <- function(entry, challenge = "ilinet") {
3535
for(i in seq_along(entry_targets)) {
3636
entry_bins <- unique(entry$bin[entry$target == entry_targets[i]])
3737

38+
if (challenge == "hopsitalization" & grepl("wk ahead",entry_targets[i] )){
39+
entry_bins <- round(as.numeric(entry_bins))
40+
41+
}
42+
3843
valid_bins <- as.character(unique(valid$bin[valid$target == entry_targets[i]]))
3944

4045
missing_bins <- setdiff(valid_bins, entry_bins)
4146
extra_bins <- setdiff(entry_bins, valid_bins)
4247

4348
if (challenge == "hospitalization"){
44-
missing_bins <- missing_bins[!is.na(missing_bins)]
49+
missing_bins <- c()# missing_bins[!is.na(missing_bins)]
4550
}
4651
if (challenge == "hospitalization" & all(is.na(entry_bins))){
4752
missing_bins <-c()

0 commit comments

Comments
 (0)