-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix performance summary bugs for subsampled PSIS-LOO CV #475
Merged
Conversation
This file contains 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
the original `mu.bs` has no `NA`s.
…s = TRUE`: If `mu.bs` has `NA`s (which is the case for subsampled PSIS-LOO CV if `baseline = "best"`), then `mu` gets modified by line `mu[is.na(mu.bs)] <- NA` and hence `auc.data` needs to be updated as well.
Previously, `NA` was returned as the AUC for the submodels. This was due to `NA`s not being handled correctly in `auc()`.
…pled PSIS-LOO CV and `deltas = FALSE`.
subsampled PSIS-LOO CV (`nloo`) with `deltas = TRUE` and `baseline = "best"`. For `baseline = "ref"`, this is only a refactor improving the safety and readability of `get_stat()`'s handling of `NA`s because for `baseline = "ref"`, we should always have no `NA`s in `lppd.bs` and `mu.bs`, so in that case, `n_notna` did not require an adjustment and also because the math operations connecting `mu` and `mu.bs` (analogously for `lppd` and `lppd.bs`) ensured that only the "inner join" of non-`NA` elements (i.e., the set of observations for which both `mu` and `mu.bs` (analogously for `lppd` and `lppd.bs`) are not `NA`) is used. This addresses question 1 from <stan-dev#94 (comment)>.
Previously, ```r weighted.sd(numeric(), numeric()) weighted.sd(NA, NA) weighted.sd(NA, NA, na.rm = TRUE) weighted.sd(0.42, 42) ``` returned `0`, `NA_real_`, `0`, `NaN`, respectively. Now, they return `NA_real_`, `NA_real_`, `NA_real_`, `NA_real_`, respectively, just like ```r sd(numeric()) sd(NA) sd(NA, na.rm = TRUE) sd(0.42) ``` .
`stat %in% c("acc", "pctcorr", "auc")` and `!is.null(y_wobs_test$y_prop)`: `n_notna` was not adapted correctly in that case (because `y_wobs_test$wobs` usually has non-`NA`s at those places where `mu` has `NA`s).
Open
fweber144
added a commit
to fweber144/projpred
that referenced
this pull request
Nov 14, 2023
from PR stan-dev#475: Since `.tabulate_stats()` gets arguments from `summary.vsel()` and friends via `...` and passes them over to `get_stat()`, omitting argument `wcv` would have made it possible for users to modify it.
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.
This fixes several bugs (mainly in
get_stat()
) that were sometimes causing incorrect predictive performance results (i.e., point estimate, standard error, confidence interval) in case of subsampled PSIS-LOO CV. For details, see the commit messages.