默认参数
m <-
h2o.gbm(
x = x,
y = y,
training_frame = train,
model_id = "GBM",
nfolds = 10,
validation_frame = valid
)
h2o.varimp(m)
h2o.performance(m, test)
调参数
m1 <-
h2o.grid("gbm",
grid_id = "GBM_grid",
search_criteria = list(strategy = "RandomDiscrete",max_model=50),
hyper_params = list(
max_depth = c(5,20,50),
min_rows = c(2,5,10),
sample_rate = c(0.5,0.8,0.95,1),
cod_sample_rate = c(0.5,0.8,0.95,1),
cod_sample_rate_per_tree = c(0.8,0.99,1),
learn_rate = c(0,1)
seed=1
),
x=x,y=y,training_frame=train,validation_frame=valid,
stopping_tolerance = 0.001,
stopping_rounds = 3,
score_tree_interval = 10,
ntrees = 400)