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

Docs overhaul #431

Open
wants to merge 41 commits into
base: dev
Choose a base branch
from
Open

Docs overhaul #431

wants to merge 41 commits into from

Conversation

dsweber2
Copy link
Contributor

@dsweber2 dsweber2 commented Jan 23, 2025

Checklist

Please:

  • Make sure this PR is against "dev", not "main".
  • Request a review from one of the current epipredict main reviewers:
    dajmcdon.
  • Make sure to bump the version number in DESCRIPTION and NEWS.md.
    Always increment the patch version number (the third number), unless you are
    making a release PR from dev to main, in which case increment the minor
    version number (the second number).
  • Describe changes made in NEWS.md, making sure breaking changes
    (backwards-incompatible changes to the documented interface) are noted.
    Collect the changes under the next release number (e.g. if you are on
    0.7.2, then write your changes under the 0.8 heading).
  • Consider pinning the epiprocess version in the DESCRIPTION file if
    • You anticipate breaking changes in epiprocess soon
    • You want to co-develop features in epipredict and epiprocess

Change explanations for reviewer

Draft ready for review:

  • Landing Page
  • Getting Started
  • Customized Forecasters
  • Reference
    • Using the add/update/remove and adjust functions
    • Smooth Quantile regression
  • preprocessing and models examples
  • backtesting forecasters

Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch

@dsweber2 dsweber2 requested a review from dajmcdon as a code owner January 23, 2025 20:59
@dajmcdon
Copy link
Contributor

/preview-docs

Copy link

github-actions bot commented Jan 23, 2025

@dshemetov
Copy link
Contributor

dshemetov commented Jan 23, 2025

Our setup is generating docs in dev/, so the link is off, this works:
https://6792d4953137ef0ce0547a4f--epipredict.netlify.app/dev/

Also FYI: the bot edits its own comment for links. Each preview is a separate link and the links stick around for like 90 days. You can see the previous links in the comment edit history.

Edit: this has been fixed on main so is no longer necessary

@dsweber2 dsweber2 force-pushed the docsDraft branch 4 times, most recently from 8044b98 to d35363e Compare January 27, 2025 22:50
@dsweber2
Copy link
Contributor Author

/preview-docs

@dsweber2
Copy link
Contributor Author

So something weird is happening with the plot for flatline_forecaster, not really sure why. Going to dig into that next.

I added an option to replace the data for the autoplot so you can compare with new data instead

@dsweber2
Copy link
Contributor Author

dsweber2 commented Feb 3, 2025

Draft of the getting started is ready, moving on to a draft of the "guts" page (name a placeholder), which is an overview of creating workflows by hand

@dsweber2
Copy link
Contributor Author

dsweber2 commented Feb 5, 2025

So something weird is happening with the plot for flatline_forecaster, not really sure why. Going to dig into that next.
image

After some digging, I don't think there are any bugs, just some edge-case behavior that we may not want:

  1. Thresholding and extrapolation don't interact well. In this case, the quantiles it fits are 0.05 and 0.95, and it correctly rounds the 5% quantile up to zero (b/c of the negative values it is actually negative w/out constraint). But, it also looks to plot the 2.5% and 97.5% quantiles, which extrapolate doesn't know should also be zero. This results in quantiles with negative values.
  2. The other thing is that the interpolated quantiles change quite a bit after thresholding if there's not very many quantiles. For example, the median gets pushed up quite a bit, but the point prediction doesn't reflect that.

My take away: never fit just the 5% and 95% quantiles. At least do the 50%. That fixes most of the jank this uncovers.

@dsweber2 dsweber2 self-assigned this Feb 7, 2025
@dsweber2
Copy link
Contributor Author

dsweber2 commented Feb 7, 2025

/preview-docs

@dshemetov
Copy link
Contributor

Including 0.5 into the user's selection sounds simple and reasonable to me. They can always filter out what they don't want.

@dsweber2
Copy link
Contributor Author

dsweber2 commented Feb 7, 2025

/preview-docs

@dsweber2
Copy link
Contributor Author

/preview-docs

@nmdefries this also updates the backtesting vignette; I'm dropping the Canadian example because it basically had no revisions.

@dsweber2
Copy link
Contributor Author

/preview-docs


``` r
two_week_ahead <- arx_forecaster(
covid_case_death_rates,
four_week_ahead <- arx_forecaster(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: This gives me an error

Error in prep.epi_recipe(blueprint$recipe, training = training, fresh = blueprint$fresh,  : 
  object 'validate_training_data' not found

I'm using the dev version of epipredict, installed today.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's internal to {recipes} (unexported). The DESCRIPTION may need to depend on a higher version. News.md here suggests 1.1.0, but worth looking.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Long term goal is to remove any dependence on internal functions from other packages)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recipes 1.1.1 worked along with an update to hardhat

@nmdefries
Copy link
Contributor

/preview-docs

...
)
```
## Fitting multi-key panel data
Copy link
Contributor

@nmdefries nmdefries Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Plot titles are cut off. It doesn't matter for this example case exactly, but it doesn't make autoplot look stellar.

Not sure how best to fit the titles in a general way. We can wrap, or make the font smaller?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is unfortunate. I suspect trying to go all the way to a "publication-ready" plot via autoplot is probably more than we can reasonably handle. This package has some examples of text that is also oversized. I suspect dealing with that requires case by case reasoning, which is best addressed by the user doing a + theme(...) to deal with their case. Perhaps demoing that is worthwhile in this case

E.g. someone asking about auto-adjusting text size

For wrapping it seems there's no great way to go about it besides guess and check.

Choosing a theme where the titles can bleed over the edge like in the first link is probably a functional if ugly solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vignettes
4 participants