parsnip icon indicating copy to clipboard operation
parsnip copied to clipboard

Prediction for rand_forest when type = "quantile"

Open stevenpawley opened this issue 6 years ago • 7 comments

I can't seem to be able to predict quantiles when using rand_forest with the ranger engine. While the ``quantreg = TRUE``` argument is passed to ranger:

library(parsnip)
library(dplyr)
data("airquality")

regr <- rand_forest(mode = "regression") %>% set_engine("ranger", quantreg = TRUE)

airquality <- na.omit(airquality)

regr_fit <- regr %>% fit(Ozone ~ ., data = airquality)

preds <- regr_fit %>% predict(airquality, type = 'quantile')

This produces the error:

Error: No quantile prediction method defined for this engine.

However, quantiles can be predicted using the underlying ranger model, e.g.:

preds <- regr_fit$fit %>% predict(airquality, type = 'quantiles')
head(preds$predictions)

stevenpawley avatar Jan 15 '19 02:01 stevenpawley

I'll get to implementing this before the next release.

topepo avatar Feb 25 '19 18:02 topepo

Hi guys,

Is there any update on the quantile Random Forest implementation?

athammad avatar Aug 23 '21 13:08 athammad

This is on our longer term plan for implementation, after we complete other work like support for survival analysis and case weights.

juliasilge avatar Aug 23 '21 14:08 juliasilge

Hi guys,

I have seen the resolution fork for quantile linear regression. Is there any update on the Quantile Random Forest implementation? I am more referring to the quantregForest R packages than using quantile parameters in ranger. (https://cran.r-project.org/web/packages/quantregForest/quantregForest.pdf)

Thanks!

roled12 avatar Apr 01 '22 14:04 roled12

This is still on our longer term plan! 👍 We are making good headway on survival analysis and case weights, and this change will need to wait on that being completed. The good news is that the changes in prediction type for survival analysis do set us up pretty well for quantile predictions.

juliasilge avatar Apr 02 '22 21:04 juliasilge

Hi, is there any update on quantile regression?

Santiago-Canon113 avatar Aug 31 '22 19:08 Santiago-Canon113

+1

Steviey avatar Dec 14 '22 20:12 Steviey