Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion Report/create_reports.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,41 @@ save_score_errors <- list()
## Score predictions
print("Evaluating state forecasts")
geo_type <- "state"
offline_signal_dir <- "signal_cache"
# Take advantage of `evalcast`'s caching feature. Suppress output since we
# only care about generating the cache.
#
# Since cache files are named using only the provided as-of date, the first
# COVIDcast call for a given as-of will be used for all subsequent calls with
# the same as-of, whether or not the cache actually contains all the desired
# `time_value`s.
#
# Since data used for scoring is fetched one day or week at a time as-of
# "today", the first such call would create a cache covering a very narrow
# date range. Later API calls would attempt to use the incomplete cache file.
#
# Circumvent this by explicitly pulling the full date range and initializing a
# complete cache for each signal used.
sources <- list(
list(data_source = "hhs", signal = "confirmed_admissions_covid_1d"),
list(data_source = "jhu-csse", signal = "confirmed_incidence_num"),
list(data_source = "jhu-csse", signal = "deaths_incidence_num")
)
invisible({
for (source in sources) {
download_signal(
data_source = source$data_source, signal = source$signal,
# "us" can also be included in `states_geos`. Drop to avoid "Data not
# fetched for some geographies" error.
geo_type = "state", geo_values = setdiff(state_geos, "us"), offline_signal_dir = offline_signal_dir
)
}
})

state_scores <- evaluate_covid_predictions(state_predictions,
err_measures,
geo_type = geo_type
geo_type = geo_type,
offline_signal_dir = offline_signal_dir
)

for (signal_name in signals) {
Expand Down
2 changes: 0 additions & 2 deletions app/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -654,12 +654,10 @@ server <- function(input, output, session) {

# When the target variable changes, update available forecasters, locations, and CIs to choose from
observeEvent(input$targetVariable, {

## summaryPlot will try to use PREV_AS_OF_DATA()
## since it has wrong data information, it needs to be removed
PREV_AS_OF_DATA(NULL)
if (input$targetVariable == "Deaths") {

## Defining Filter
FILTER <- DEATH_FILTER
} else if (input$targetVariable == "Cases") {
Expand Down