-
Notifications
You must be signed in to change notification settings - Fork 88
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
Quantile predictions output constructor #1191
Conversation
Merge branch 'quantile-mode' of https://github.com/dajmcdon/parsnip into quantile-mode # Conflicts: # R/predict.R
…nto quantile-mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stoked that this is coming together. Will defer to others on feedback related to the design/interface, but some engineering and code-style edits!
Co-authored-by: Simon P. Couch <[email protected]>
@simonpcouch Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good so far. left a couple of suggestions
Can we call it |
Thanks for making this
Nope, I'm good with using this class! |
Co-authored-by: Max Kuhn <[email protected]>
One other small thing... let's remove row and column names from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And one more person to chime in 😆 Only small comments though, this is looking great already!
expect_s3_class(one_quant_pred$.pred_quantile[[1]], c("tbl_df", "tbl", "data.frame")) | ||
expect_named(one_quant_pred$.pred_quantile[[1]], c(".pred_quantile", ".quantile_level")) | ||
expect_true(nrow(one_quant_pred$.pred_quantile[[1]]) == 1L) | ||
expect_s3_class( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testthat has expect_vector()
specifically for testing vctrs vectors, that seems relevant here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output is a vector but the prototype for expect_vector()
has matrix and vector inputs whose sizes must match and cannot be zero. It's not very straightforward to do that; It's a quare peg in a round hole. I think that the complexity there is not really worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woot woot!
@dajmcdon Merge time! One note... after looking into performance metrics, we realized that For these cases, we move infrastructure to hardhat (which everyone depends on at some level). After I merge this, I’ll PR into hardhat to put the functions there, and then PR to parsnip to remove them. |
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
@topepo
quantile_levels
).rq()
predictions (1 or moretau
/quantile_levels
).I added a test for the constructor and adjusted your tests for the
quantreg
engine.Don't hesitate to ask for more changes! Or we can revisit if you'd really prefer the tibble list-col version.