-
Notifications
You must be signed in to change notification settings - Fork 10
Docs overhaul #431
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
Open
dsweber2
wants to merge
62
commits into
dev
Choose a base branch
from
docsDraft
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Docs overhaul #431
Changes from 58 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
5c5c87c
second readthrough of README.Rmd
dsweber2 007e2b4
make for manually clearing the caches
dsweber2 2b5908c
styler
dsweber2 e47b5d7
missed an image in the man version
dsweber2 f8b43c4
getting started page
dsweber2 77cbeb9
fixing rebase problem
dsweber2 1539552
linewrapping
dsweber2 91a980b
pushing only the dev docs
dsweber2 a52934a
isn't building the readme
dsweber2 06d5581
readme.rmd red/yellow -> blue/black
dsweber2 eed91fa
training on only the shown subset
dsweber2 39e203c
autoplot new data
dsweber2 0be48a0
using new autoplot
dsweber2 6e3d2ff
getting started first draft
dsweber2 c7f5d3b
much more complete guts example, branching flatline fixes
dsweber2 7d1273e
fix for flatline discovered, rename guts
dsweber2 2054f9c
docs, styler
dsweber2 763885e
passing check & news
dsweber2 ad8bf93
revising custom_epiworkflows
dsweber2 5177e68
some more editing
dsweber2 a5270cc
finished custom_workflows, reviewing backtesting
dsweber2 563f185
backtesting rmd rewrite
dsweber2 9ac8c82
dropping CAN backtesting example b/c ~no revisions
dsweber2 4f0c7e6
formatting
dsweber2 a552e14
|> in backtesting, dropped a section in get started
dsweber2 decc963
landing page wording and get code running
nmdefries ad236b6
landing page again but in Rmd
nmdefries 9a8fc7c
consistent naming, 7dav pull instead of manually
dsweber2 97ded60
going back to just using the API call
dsweber2 2a29a6b
recipes version, include epiprocess in the rmds
dsweber2 bd72da5
rebuild landing page
nmdefries e638288
first half epipredict.Rmd
nmdefries 93a9e8c
custom header, dropping arx_classifier smooth-qr
dsweber2 2f4fa89
follow up on first half of epipredict.Rmd
dsweber2 5003736
avoid [link] parsing
dsweber2 28063be
reorganize reference page
dsweber2 c2bc4ba
postprocessing -> post-processing
dsweber2 34d7a05
lots of reference updates
dsweber2 b61a30b
forecast needs `...` as a generic
dsweber2 ea276f3
include climate, only calculate necessary days
dsweber2 c3287d2
Adding short blurb on cdc_flatline
dsweber2 01f1d22
extra details for symmetrize
dsweber2 84ed412
epipredict.Rmd
nmdefries 9bbf7bf
backtesting.rmd
nmdefries bb4025c
first half custom_epiworkflows.Rmd
nmdefries 05f1507
second half custom_epiworkflows.Rmd
nmdefries c9361ae
various requested changes
dsweber2 cdf3730
backtesting version un/faithful clarification
nmdefries 7304110
why comparing to final data
nmdefries 4df2535
fixing backtest truth data plot
dsweber2 3aad6b8
backtesting.rmd comment fixes
nmdefries 5469dda
add alternate step names and say if optional/not
nmdefries b481a28
get_test_data help
nmdefries 764b7f9
get_test_data forecasts identical
nmdefries c716235
clarify changing frosting with model
nmdefries 42b146d
classifier chunk comments
nmdefries ef99e42
model-specific layers
nmdefries a958343
removing resolved todos
dsweber2 2056e0a
dan's simple suggestions
dsweber2 ef1fd58
move pkgdown-watch, better climate ex, some wording
dsweber2 4a9f43e
moving library, geo-pooling phrasing
dsweber2 9f0af0a
fit -> estimate
dsweber2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## | ||
# epipredict docs build | ||
# | ||
|
||
# knitr doesn't actually clean it's own cache properly; this just deletes any of | ||
# the article knitr caches in vignettes or the base | ||
clean_knitr: | ||
rm -r *_cache; rm -r vignettes/*_cache | ||
clean_site: | ||
Rscript -e "pkgdown::clean_cache(); pkgdown::clean_site()" | ||
# this combines | ||
clean: clean_knitr clean_site | ||
|
||
# end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,26 +1,29 @@ | ||||||
#' Direct autoregressive forecaster with covariates | ||||||
#' | ||||||
#' This is an autoregressive forecasting model for | ||||||
#' [epiprocess::epi_df][epiprocess::as_epi_df] data. It does "direct" forecasting, meaning | ||||||
#' that it estimates a model for a particular target horizon. | ||||||
#' [epiprocess::epi_df][epiprocess::as_epi_df] data. It does "direct" | ||||||
#' forecasting, meaning that it estimates a model for a particular target | ||||||
#' horizon of `outcome` based on the lags of the `predictors`. See the [Get | ||||||
dsweber2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
#' started vignette](../articles/epipredict.html) for some worked examples and | ||||||
#' [Custom epi_workflows vignette](../articles/custom_epiworkflows.html) for a | ||||||
#' recreation using a custom `epi_workflow()`. | ||||||
#' | ||||||
#' | ||||||
#' @param epi_data An `epi_df` object | ||||||
#' @param outcome A character (scalar) specifying the outcome (in the | ||||||
#' `epi_df`). | ||||||
#' @param outcome A character (scalar) specifying the outcome (in the `epi_df`). | ||||||
#' @param predictors A character vector giving column(s) of predictor variables. | ||||||
#' This defaults to the `outcome`. However, if manually specified, only those variables | ||||||
#' specifically mentioned will be used. (The `outcome` will not be added.) | ||||||
#' By default, equals the outcome. If manually specified, does not add the | ||||||
#' outcome variable, so make sure to specify it. | ||||||
#' @param trainer A `{parsnip}` model describing the type of estimation. | ||||||
#' For now, we enforce `mode = "regression"`. | ||||||
#' @param args_list A list of customization arguments to determine | ||||||
#' the type of forecasting model. See [arx_args_list()]. | ||||||
#' This defaults to the `outcome`. However, if manually specified, only those | ||||||
#' variables specifically mentioned will be used. (The `outcome` will not be | ||||||
#' added.) By default, equals the outcome. If manually specified, does not | ||||||
#' add the outcome variable, so make sure to specify it. | ||||||
#' @param trainer A `{parsnip}` model describing the type of estimation. For | ||||||
dsweber2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
#' now, we enforce `mode = "regression"`. | ||||||
#' @param args_list A list of customization arguments to determine the type of | ||||||
#' forecasting model. See [arx_args_list()]. | ||||||
#' | ||||||
#' @return A list with (1) `predictions` an `epi_df` of predicted values | ||||||
#' and (2) `epi_workflow`, a list that encapsulates the entire estimation | ||||||
#' workflow | ||||||
#' @return An `arx_fcast`, with the fields `predictions` and `epi_workflow`. | ||||||
#' `predictions` is an `epi_df` of predicted values while `epi_workflow()` is | ||||||
dsweber2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
#' the fit workflow used to make those predictions | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought we were using fit in the context of workflows? |
||||||
#' @export | ||||||
#' @seealso [arx_fcast_epi_workflow()], [arx_args_list()] | ||||||
#' | ||||||
|
@@ -29,15 +32,18 @@ | |||||
#' dplyr::filter(time_value >= as.Date("2021-12-01")) | ||||||
#' | ||||||
#' out <- arx_forecaster( | ||||||
#' jhu, "death_rate", | ||||||
#' jhu, | ||||||
#' "death_rate", | ||||||
#' c("case_rate", "death_rate") | ||||||
#' ) | ||||||
#' | ||||||
#' out <- arx_forecaster(jhu, "death_rate", | ||||||
#' out <- arx_forecaster(jhu, | ||||||
#' "death_rate", | ||||||
#' c("case_rate", "death_rate"), | ||||||
#' trainer = quantile_reg(), | ||||||
#' args_list = arx_args_list(quantile_levels = 1:9 / 10) | ||||||
#' ) | ||||||
#' out | ||||||
arx_forecaster <- function( | ||||||
epi_data, | ||||||
outcome, | ||||||
|
@@ -60,7 +66,7 @@ arx_forecaster <- function( | |||||
forecast_date <- args_list$forecast_date %||% forecast_date_default | ||||||
|
||||||
|
||||||
preds <- forecast(wf, forecast_date = forecast_date) %>% | ||||||
preds <- forecast(wf) %>% | ||||||
as_tibble() %>% | ||||||
select(-time_value) | ||||||
|
||||||
|
@@ -262,10 +268,13 @@ arx_fcast_epi_workflow <- function( | |||||
#' @param quantile_levels Vector or `NULL`. A vector of probabilities to produce | ||||||
#' prediction intervals. These are created by computing the quantiles of | ||||||
#' training residuals. A `NULL` value will result in point forecasts only. | ||||||
#' @param symmetrize Logical. The default `TRUE` calculates | ||||||
#' symmetric prediction intervals. This argument only applies when | ||||||
#' residual quantiles are used. It is not applicable with | ||||||
#' `trainer = quantile_reg()`, for example. | ||||||
#' @param symmetrize Logical. The default `TRUE` calculates symmetric prediction | ||||||
#' intervals. This argument only applies when residual quantiles are used. It | ||||||
#' is not applicable with `trainer = quantile_reg()`, for example. This is | ||||||
#' achieved by including both the residuals and their negation. Typically, one | ||||||
#' would only want non-symmetric quantiles when increasing trajectories are | ||||||
#' quite different from decreasing ones, such as a strictly postive variable | ||||||
#' near zero. | ||||||
dsweber2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
#' @param nonneg Logical. The default `TRUE` enforces nonnegative predictions | ||||||
#' by hard-thresholding at 0. | ||||||
#' @param quantile_by_key Character vector. Groups residuals by listed keys | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.