-
Notifications
You must be signed in to change notification settings - Fork 105
Quantile predictions output constructor #1191
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
f7e25d5
small change to predict checks
dajmcdon 55897a5
merge remote
dajmcdon 1980cb4
Merge branch 'quantile-mode' of https://github.com/dajmcdon/parsnip i…
dajmcdon 43d1918
add vctrs for quantiles and test, refactor *_rq_preds
dajmcdon 728c046
revise tests
dajmcdon 32ea877
Apply some of the suggestions from code review
dajmcdon cc1f8de
rename tests on suggestion from code review
dajmcdon 1d27996
export missing funs from vctrs for formatting
dajmcdon 4a996c2
convert errors to snapshot tests
dajmcdon f03bcc3
pass call through input check
dajmcdon 73e43e9
update snapshots for caller_env
dajmcdon 7ca367e
rename to parsnip_quantiles, add format snapshot tests
dajmcdon 49cc02e
Apply suggestions from @topepo
dajmcdon 3ff6930
rename parsnip_quantiles to quantile_pred
dajmcdon 8e601c5
rename parsnip_quantiles to quantile_pred and add vector probability …
dajmcdon f4c90ca
fix: two bugs introduced earlier
dajmcdon 13b6010
add formatting tests for single quantile
dajmcdon f3ac33e
replace walk with a loop to avoid "Error in map()"
dajmcdon 7ffcb38
remove row/col names
dajmcdon 90655c9
adjust quantile_pred format
dajmcdon e8feed3
as_tibble method
topepo 2748d06
updated NEWS file
topepo 5b09175
add PR number
topepo 30760de
small new update
topepo 926d587
helper methods
topepo b575c34
update docs
83c744b
re-enable quantiles prediction for #1203
topepo 11dd169
update some tests
topepo 9fa5bf0
no longer needed
1e74bae
use tibble::new_tibble
9122073
braces
9ee98e9
test as_tibble
9ce72c0
remove print methods
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
dajmcdon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
test_that("vec_quantiles error types", { | ||
expect_error(vec_quantiles(1:10, 1:4 / 5), "matrix") | ||
expect_error( | ||
vec_quantiles(matrix(1:20, 5), -1:4 / 5), | ||
"`quantile_levels` must be a number between 0 and 1" | ||
) | ||
dajmcdon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
expect_error( | ||
vec_quantiles(matrix(1:20, 5), 1:5 / 6), | ||
"The number of columns in `values` must be equal to" | ||
) | ||
expect_error( | ||
vec_quantiles(matrix(1:20, 5), 4:1 / 5), | ||
"must be sorted in increasing order" | ||
) | ||
}) | ||
|
||
test_that("vec_quantiles outputs", { | ||
v <- vec_quantiles(matrix(1:20, 5), 1:4 / 5) | ||
expect_s3_class(v, "vctrs_quantiles") | ||
expect_identical(attr(v, "quantile_levels"), 1:4 / 5) | ||
expect_identical( | ||
vctrs::vec_data(v), | ||
lapply(vctrs::vec_chop(matrix(1:20, 5)), drop) | ||
) | ||
}) |
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.
Uh oh!
There was an error while loading. Please reload this page.