Skip to content
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

Enabling what parameter from ranger.predict to enable predictions via quantile random forest #157

Open
jmaddalena opened this issue Feb 26, 2024 · 0 comments

Comments

@jmaddalena
Copy link

In the ranger library, the following is presented as the arguments for the predict call from the ranger model:

## S3 method for class 'ranger'
predict(
object,
data = NULL,
predict.all = FALSE,
num.trees = object$num.trees,
type = "response",
se.method = "infjack",
quantiles = c(0.1, 0.5, 0.9),
what = NULL,
seed = NULL,
num.threads = NULL,
verbose = TRUE,
...
)

The argument what is specified as:

User specified function for quantile prediction used instead of quantile. Must return numeric vector, see examples.

This can be used to generate estimates of uncertainty via quantile random forest via simulation, as noted in this example in the ranger documentation:

## Quantile regression forest with user-specified function
rf <- ranger(mpg ~ ., mtcars[1:26, ], quantreg = TRUE)
pred <- predict(rf, mtcars[27:32, ], type = "quantiles",
what = function(x) sample(x, 10, replace = TRUE))
pred$predictions

Is there a way to do this in skranger by other means or is this a feature you would consider supporting in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant