tidymodels / parsnip

A tidy unified interface to models
https://parsnip.tidymodels.org
Other
601 stars 89 forks source link

Quantile predictions output constructor #1191

Closed dajmcdon closed 2 months ago

dajmcdon commented 2 months ago

@topepo

  1. This is just the vctrs constructor.
  2. It only allows a matrix input (with columns corresponding to quantile_levels).
  3. It works with both types of rq() predictions (1 or more tau/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.

dajmcdon commented 2 months ago

@simonpcouch Thanks!

topepo commented 2 months ago

Can we call it "quantile_pred"? We have a special "class_pred" vctrs class in probably.

topepo commented 2 months ago

Thanks for making this

Or we can revisit if you'd really prefer the tibble list-col version.

Nope, I'm good with using this class!

topepo commented 2 months ago

One other small thing... let's remove row and column names from values in parsnip_quantiles(). They carry over into the vctrs object (although you can't see them unless you do something like unclass())

topepo commented 2 months ago

@dajmcdon Merge time!

One note... after looking into performance metrics, we realized that quantile_pred() and its methods will also be needed in yardstick. We want to avoid adding parsnip as a dependency there.

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.

github-actions[bot] commented 2 months ago

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.