Busabase
Busabase 是一个开源(MIT)数据库与 AI 智能体工作空间——将数据、文档、技能和应用集成于一体。您可以本地运行、在网络内自托管或使用 Busabase Cloud,从而开启新时代。
AI 翻译
Facilitate the evaluation of forecasts in a convenient framework based on data.table. It allows user to to check their forecasts and diagnose issues, to visualise forecasts and missing data, to transf
翻译准备中
数据R · TeXGitHub @epiforecasts在线运营者未确认
试用过了吗? 点一下就好,无需登录。
Utilities for Scoring and Assessing Predictions
翻译准备中
正在加载完整 README。
查看完整 README ↗The scoringutils package facilitates the process of evaluating
forecasts in R, using a convenient and flexible data.table-based
framework. It provides broad functionality to check the input data and
diagnose issues, to visualise forecasts and missing data, to transform
data before scoring, to handle missing forecasts, to aggregate scores,
and to visualise the results of the evaluation. The package is easily
extendable, meaning that users can supply their own scoring rules or
extend existing classes to handle new types of forecasts.
A good starting point are the vignettes
Details on the metrics implemented and Scoring forecasts directly. We also have several related manuscripts
and
Nikos I. Bosse, Sam Abbott, Anne Cori, Edwin van Leeuwen, Johannes Bracher* and Sebastian Funk* (*: equal contribution) (2023).
Scoring epidemiological forecasts on transformed scales, PLoS Comput Biol 19(8): e1011393 https://doi.org/10.1371/journal.pcbi.1011393
for specific details on transforming forecasts for scoring.
Install the CRAN version of this package using
install.packages("scoringutils")
Install the unstable development version from GitHub using
remotes::install_github("epiforecasts/scoringutils", dependencies = TRUE)
scoringutils currently supports scoring the following forecast types:
binary: a probability for a binary (yes/no) outcome variable.point: a forecast for a continuous or discrete outcome variable that
is represented by a single number.quantile: a probabilistic forecast for a continuous or discrete
outcome variable, with the forecast distribution represented by a set
of predictive quantiles.sample: a probabilistic forecast for a continuous or discrete
outcome variable, with the forecast represented by a finite set of
samples drawn from the predictive distribution.nominal categorical forecast with unordered outcome possibilities
(generalisation of binary forecasts to multiple outcomes)The expected input format is generally a data.frame (or similar) with
required columns observed, and predicted that holds the forecasts
and observed values. Exact requirements depend on the forecast type. For
more information, have a look at the
paper,
call ?as_forecast_binary, ?as_forecast_quantile etc., or have a look
at the example data provided in the package (example_binary,
example_point, example_quantile, example_sample_continuous,
example_sample_discrete, example_nominal).
Before scoring, input data needs to be validated and transformed into a
forecast object using one of the as_forecast_<type>() functions.
forecast_quantile <- example_quantile |>
as_forecast_quantile(
forecast_unit = c(
"location", "forecast_date", "target_end_date", "target_type", "model", "horizon"
)
)
#> ℹ Some rows containing NA values may be removed. This is fine if not
#> unexpected.
print(forecast_quantile, 2)
#> Forecast type: quantile
#> Forecast unit:
#> location, forecast_date, target_end_date, target_type, model, and horizon
#>
#> Key: <location, target_end_date, target_type>
#> observed quantile_level predicted location forecast_date target_end_date
#> <num> <num> <int> <char> <Date> <Date>
#> 1: 127300 NA NA DE <NA> 2021-01-02
#> 2: 4534 NA NA DE <NA> 2021-01-02
#> ---
#> 20544: 78 0.975 611 IT 2021-07-12 2021-07-24
#> 20545: 78 0.990 719 IT 2021-07-12 2021-07-24
#> target_type model horizon
#> <char> <char> <num>
#> 1: Cases <NA> NA
#> 2: Deaths <NA> NA
#> ---
#> 20544: Deaths epiforecasts-EpiNow2 2
#> 20545: Deaths epiforecasts-EpiNow2 2
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗