Minimal wrapper around caret::train with no tuning. Hyperparameters can be passed via ... as named arguments.

wrap_caret(X, y, method = "rf", ...)

Arguments

X

Feature matrix or data frame

y

Response vector

method

caret model method (default "rf")

...

Named hyperparameters (e.g., mtry = 3, ntree = 500)

Value

Object with class "mlS3_caret"

Examples

if (FALSE) { # \dontrun{
# Only runs if caret is installed
mod <- wrap_caret(X_train, y_train, method = "rf", mtry = 3)
pred <- predict(mod, newx = X_test)
} # }