Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

reichlab/zoltr

Repository files navigation

Overview

This package contains functions for working with theZoltar forecast repository’s API,including projects, models, forecasts, and truth. Read more about thispackage at thezoltr pkgdown site.Documentation on Zolar itself is atdocs.zoltardata.com.

Installation

You can install the released version of zoltr fromCRAN with:

install.packages("zoltr")

And the development version fromGitHub with:

# install.packages("devtools")devtools::install_github("reichlab/zoltr")

Note: Due to the rapid pace of zoltr development, CRAN version lagsbehind development. We highly suggest you install the developmentversion to get the latest features.

Getting started

For those starting out we recommend you begin with the “Getting Started”vignette.

Usage

Read more at thezoltr pkgdown site, butbriefly you use thenew_connection() function to create a connectiontoZoltar and then pass that connectionalong with theURL of the resource of interest (e.g., a project,model, or forecast) to this package’s various functions likeprojects() orproject_info().

library(zoltr)zoltar_connection<- new_connection()zoltar_authenticate(zoltar_connection, Sys.getenv("Z_USERNAME"), Sys.getenv("Z_PASSWORD"))zoltar_connection#> ZoltarConnection 'https://zoltardata.com' authenticated (exp=2024-06-27 15:55:21 UTC)the_projects<- projects(zoltar_connection)project_url<-the_projects[the_projects$name=="Docs Example Project","url"]the_project_info<- project_info(zoltar_connection,project_url)names(the_project_info)#>  [1] "id"           "url"          "owner"        "is_public"    "name"#>  [6] "description"  "home_url"     "logo_url"     "core_data"    "truth"#> [11] "model_owners" "models"       "units"        "targets"      "timezeros"the_project_info$name#> [1] "Docs Example Project"

Forecast data format

The native forecast data format supported by the Zoltar API is alist.Seedocs.zoltardata.com for formatdetails. You can find an example at vignettes/docs-predictions.json . Byconvention this package referred to this asforecast_data. Thispackage supports conversion to this format (which is used throughout thepackage) from the CDC’s CSV file format [1] via theforecast_data_from_cdc_csv_file() function. Future versions willsupport bidirectional conversion, as well as support for a more generalCSV format.

[1] Details about the CDC CSV format were formerly found in a Worddocument (“flu_challenge_2016-17_update.docx”) that’s since beendeleted. From that document’s “Objectives” section:

For each week during the season, participants will be asked to providenational and regional probabilistic forecasts for the entire influenzaseason (seasonal targets) and for the next four weeks (four-week aheadtargets). The seasonal targets are the onset week, the peak week, andthe peak intensity of the 2016-2017 influenza season. The four-weekahead targets are the percent of outpatient visits experiencinginfluenza-like illness (ILI) one week, two weeks, three weeks, andfour weeks ahead from date of the forecast.


[8]ページ先頭

©2009-2025 Movatter.jp