Repository navigation
Adding pred_measure feature - #363
florence-bockting wants to merge 192 commits into
Conversation
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 4597a83 is merged into loo-v3.0.0:
Further explanation regarding interpretation and methodology can be found in the documentation. |
|
There is an open issue requesting a subset() method for psis objects #343 and an (unrelated) open PR #110. Might be worth considering whether we can address this as well in this refactoring PR. If yes, we should
Moved this to PR #379 |
pred_measure feature
Overview of changesItems marked (#380) come from the merged User-facing functions
Internal functionsNew in #363
From #380
|
|
@jgabry just a quick checkin, whether you received the review notification. |
|
Thanks for the reminder! I missed the first notification. It looks like there are a couple of merge conflicts, although they're files that don't affect my ability to review it. |
Fixes #281
Fixes #223, #213, #201, #135, #220
Summary
This PR adds a predictive performance API. It computes density scores, scoring rules, and point-prediction metrics under four evaluation sources: in-sample, PSIS-LOO, k-fold, and holdout (test data).
insample_pred_measure(),loo_pred_measure(),kfold_pred_measure(),test_pred_measure(), andpred_measure().measure_*().supported_measures_list()lists them.measure_rps()andmeasure_srps()use oneypreddraw matrix and a PWM estimator ((loo_)(s)crps could ask for only one argument with predictions #223).loo_pred_measure()accepts a pre-computedpsis_object(loo_predictive_metric and loo_crps could accept psis objects to reduce computation #213).model_compare()compares models on all measures (loo_compare for crps and loo_crps #220). It comes from Introducemodel_compare()for model comparison with support of new predictive measures #380, which is merged into this branch.elpd(),crps(),scrps(),loo_crps(),loo_scrps(),loo_predictive_metric(), andloo_compare()are deprecated. They still work with their current APIs.The comment below lists all new features and functions. It marks the parts that come from #380.
How to navigate this PR
notes/developer-notes.md: status, design decisions, numerical comparisonsnotes/design-discussions/model_compare.md: review decisions formodel_compare()(Introducemodel_compare()for model comparison with support of new predictive measures #380)vignettes/articles-online-only/overview-measures.Rmd: supported measures and their definitionsvignettes/articles-online-only/pred-measure-workflow.Rmd: end-to-end workflowvignettes/articles-online-only/model-comparison.Rmd: Model comparison: Explanation ofmodel_compare()(Introducemodel_compare()for model comparison with support of new predictive measures #380)vignettes/migration-guide.Rmd: deprecated functions and their replacementsDeprecations (implementations retained)
elpd()measure_elpd()/*_pred_measure()crps(),scrps()(x,x2)measure_rps(),measure_srps()(ypred)loo_crps(),loo_scrps()loo_pred_measure(..., measure = "rps" | "srps")loo_predictive_metric()loo_pred_measure()loo_compare()(#380)model_compare()Each deprecated function warns once per session.
Dependencies
Vignettes, test-data generation, and pkgdown CI install brms from GitHub
masteras k-fold support for categorical models (brms#1890) is not yet on CRAN. Remove the pin after the next brms CRAN release.Known limitations
group_idsgrouping is not implemented.Acknowledgements
This work builds on a prototype by @VisruthSK (VisruthSK/loo-sandbox) under guidance from @jgabry.