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 formula or character describing the model to fit. Interaction terms supported only for numerical variables.

data

Training data of class data.frame, matrix, dgCMatrix (Matrix) or gwaa.data (GenABEL).

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 ranger function.

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


[Package hedgedrf version 0.0.1 Index]