if (FALSE) {
library(randomForest)
X <- iris[, 1:4]
y <- iris$Species
models <- list(
glm = Model$new(caret::train),
rf = Model$new(randomForest::randomForest),
xgb = Model$new(caret::train)
)
params <- list(
glm = list(method = "glmnet",
tuneGrid = data.frame(alpha = 0, lambda = 0.01),
trControl = trainControl(method = "none")),
rf = list(ntree = 150),
xgb = list(method = "xgbTree",
tuneGrid = data.frame(nrounds = 150, max_depth = 3, eta = 0.3,
gamma = 0, colsample_bytree = 1,
min_child_weight = 1, subsample = 1),
trControl = trainControl(method = "none"))
)
results <- benchmark(models, X, y, cv = 5, params = params,
show_progress = TRUE, verbose = TRUE)
print(results)
}
Run the code above in your browser using DataLab