hedgedrf {hedgedrf} | R Documentation |
hedgedrf
Description
hedgedrf
Usage
hedgedrf(
formula = NULL,
data = NULL,
x = NULL,
y = NULL,
num_iter = NULL,
kappa = 2,
...
)
Arguments
formula |
Object of class |
data |
Training data of class |
x |
Predictor data (independent variables), alternative interface to data with formula or dependent.variable.name. |
y |
Response vector (dependent variable), alternative interface to data with formula or dependent.variable.name. For survival use a Surv() object or a matrix with time and status. |
num_iter |
Number of iterations for the optimization algorithm. |
kappa |
Amount of regularization to apply to the tree weights. 1 implies no shorting, 2 implies no more than 50% shorting, etc. |
... |
Additional arguments to pass to the |
Value
An object of class hedgedrf
containing the tree weights and
a ranger object. The tree weights can be used to construct a hedged random
forest with the predict.hedgedrf
function. For more details about the
ranger object, see the ranger documentation.
Examples
rf <- hedgedrf(mpg ~ ., mtcars[1:26, ])
pred <- predict(rf, mtcars[27:32, ])
pred