Repository navigation
Adding pred_measure feature - #363
florence-bockting wants to merge 220 commits into
Conversation
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 625d10f 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
|
That plan seems reasonable. A couple things I noticed that aren't mentioned in the summary table:
I'll take a look at the PRs you started opening soon. |
… posthoc, custom names
Call lifecycle::deprecate_soft() before UseMethod() in loo_compare(), crps(), scrps(), loo_crps(), loo_scrps(), elpd(), and loo_predictive_metric(). Remove .deprecate_once(). Add tests that compare the old and new functions.
Yes, these are in my notes but I left them out of the table. Here is where they go:
|
Review #363 (1/19): fix E|X - X'| rounding, acc/bacc y length, RMSE SE diff
Review #363 (2/19): fix model_compare() estimates by name, default names, measure check
…/loo into fix/pred-measure-inputs
Review #363 (4/19): Soft-deprecate old functions with lifecycle
Review #363 (3/19): Fix pred_measure input checks: psis_object, dims, posthoc, custom names
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.