# \donttest{
## Requires prior installation of suggested package gbm to run
## May require a long runtime
# Automatically generated grid
model_fit <- fit(sale_amount ~ ., data = ICHomes,
model = TunedModel(GBMModel))
varimp(model_fit)
(tuned_model <- as.MLModel(model_fit))
summary(tuned_model)
plot(tuned_model, type = "l")
# Randomly sampled grid points
fit(sale_amount ~ ., data = ICHomes,
model = TunedModel(
GBMModel,
grid = TuningGrid(size = 1000, random = 5)
))
# User-specified grid
fit(sale_amount ~ ., data = ICHomes,
model = TunedModel(
GBMModel,
grid = expand_params(
n.trees = c(50, 100),
interaction.depth = 1:2,
n.minobsinnode = c(5, 10)
)
))
# }
Run the code above in your browser using DataLab