Repository navigation
Review #363 (7/19): Results no longer inherit the loo classes; error for subsampled loo - #434
Draft
florence-bockting wants to merge 4 commits into
Draft
florence-bockting wants to merge 4 commits into
florence-bockting wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix/pred-measure-args #434 +/- ##
=========================================================
+ Coverage 92.44% 92.48% +0.03%
=========================================================
Files 38 38
Lines 4712 4710 -2
=========================================================
Hits 4356 4356
+ Misses 356 354 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if d914616 is merged into fix/pred-measure-args:
Further explanation regarding interpretation and methodology can be found in the documentation. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 7/19 for the review of #363. This PR stacks on #430.
Results no longer inherit the
loo,psis_looandkfoldclassesReview comments: main review ("What if we stop inheriting …"), r4544867674
Implementation:
.add_attributes()sets the class toc("<source>_pred_measure", "pred_measure")(R/pred_measure-compute.R). It still copies the other attributes of thelooorkfoldobject (e.g.K,folds).measure_*()results have the class"measure"only (R/pred_measure-builtin.R)..model_compare_inputs()errors for a"measure"object: "Cannot compare 'measure' objects. Use a *_pred_measure() function for each model." (R/model_compare.R). Before,model_compare(m1, m2)failed with "dim(X) must have a positive length". The check coversmodel_compare(m1, m2),model_compare(list(m1, m2))and a mix with alooobject. The message does not namemodel_compare(), because the deprecatedloo_compare()also calls this function.model_compare.default()about the order of theis.loo()check is removed. It is no longer true.@returnofloo_pred_measure()no longer lists"loo"or other inherited classes.Effects:
loo_model_weights()no longer accepts aloo_pred_measureresult.plot()for Pareto k no longer works on aloo_pred_measureresult.print(x, plot_k = TRUE),pareto_k_values()andpareto_k_table()still work.Tests:
test_pred_measure.R: theis.loo()andis.psis_loo()expectations are replaced by one test. It checks the exact classes of results fromloo_pred_measure()(three input forms),kfold_pred_measure()andinsample_pred_measure(). On the old code thelooandkfoldexpectations fail (4 of 5).test_compare.R: a new test checks the error for the three call forms above. All three fail on the old code. The data has 32 observations, like thewaicobjectw1. Thus the mixed call fails on themeasureobject, not on the number of observations.loo_pred_measure()errors for subsampledlooobjectsReview comment: r4544589870
Implementation:
do_pred_measure()errors whenloois apsis_loo_ssobject (R/pred_measure-compute.R): "loo_pred_measure()does not support subsampled objects. Useloo(), or compare the <psis_loo_ss> objects withmodel_compare()." The check runs before thepsis_objectcheck. Thus a subsampled object without apsis_objectdoes not get thesave_psis = TRUEhint.Full support needs new estimators for the measures other than
elpd.Tests:
test_pred_measure.Rgets a test withas.psis_loo_ss(res$loo). On the old codeloo_pred_measure()returns a result with no error, so the test fails.Test runs
The tests that match
pred_measure|compare|print|model_weighting|subsampling_cases|deprecatedpass.This PR was assisted by use of LLM.