Basic Question About Grid Search and Cross Validation

34 views
Skip to first unread message

Lorenzo Isella

unread,
Oct 20, 2016, 3:51:18 PM10/20/16
to h2os...@googlegroups.com
Dear All,
I am back to using h2o (from R) after ages.
I am a caret/mlr user to tune model hyperparameters.
I discovered that now h2o offers cross validation and grid search, but
it is not clear how to combine them for me.
Apologies for now providing any code, but if I could I would not be
asking this question.
Can anyone provide a simple self-contained example of a random Forest
model where cross validation and grid search are used to select the
"best" mtries value?
Many thanks

Lorenzo

Erin LeDell

unread,
Nov 3, 2016, 9:01:37 PM11/3/16
to Lorenzo Isella, h2os...@googlegroups.com

Here are some examples of grid search in H2O R:

And here is a code snippet which shows how to get the "best" model for a grid.  You first have to decide which metric you care about (this uses AUC):

auc_table <- h2o.getGrid(grid_id = "eeg_demo_gbm_grid", sort_by = "auc", decreasing = TRUE)
best_model <- h2o.getModel(auc_table@model_ids[[1]])
h2o.auc(best_model, valid = TRUE)  
-Erin
On 10/20/16 12:51 PM, Lorenzo Isella wrote:
Dear All, I am back to using h2o (from R) after ages. I am a caret/mlr user to tune model hyperparameters. I discovered that now h2o offers cross validation and grid search, but it is not clear how to combine them for me. Apologies for now providing any code, but if I could I would not be asking this question. Can anyone provide a simple self-contained example of a random Forest model where cross validation and grid search are used to select the "best" mtries value? Many thanks Lorenzo
-- 
Erin LeDell Ph.D.
Statistician & Machine Learning Scientist | H2O.ai
Reply all
Reply to author
Forward
0 new messages