Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add contant baseline model #88

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions ensembles/models/unweighted.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ target_date <- as.Date(readRDS(here("data", "target_date.rds")))
source(here("utils", "load_submissions.R"))
forecasts <- load_submissions(target_date, "all-models", summarise = FALSE)

# filter out baseline models for ensembling
forecasts <- forecasts[!(model == "Baseline")]

# Make ensembles ----------------------------------------------------------
cols <- setdiff(colnames(forecasts), c("value", "model"))
mean <- copy(forecasts)[, .(value = mean(value)), by = cols]
Expand Down
3 changes: 3 additions & 0 deletions ensembles/models/weighted.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ forecasts <- list.files(here("submissions", "all-models"))
forecasts <- map(forecasts, ~ fread(here("submissions", "all-models", .)))
forecasts <- rbindlist(forecasts)[grepl("inc", target)]

# filter out baseline models for ensembling
forecasts <- forecasts[!(model == "Baseline")]

# get current forecast
current_forecasts <- forecasts[forecast_date == target_date]
# exclude US from training
Expand Down
Loading