When I run:
data_h = h2o.H2OFrame(data)
### Edit: added asfactor() below to change integer target array.
data_h["BPA"] = data_h["BPA"].asfactor()
train, valid = data_h.split_frame(ratios=[.7], seed = 1234)
features = ["bq_packaging_consumepkg", "bq_packaging_microwave_v3", "bq_packaging_plasticbottle_v2",
"bq_packaging_hotdrink_v3", "bq_packaging_microwsaran_v3","bq_food_cannedfoods_v2"]
target = "BPA"
# Hyperparameter tuning
params = {"ntrees": [50, 100, 200, 300, 400, 500, 600],
"max_depth": [10, 30, 50, 70, 90, 110],
"min_rows": [1,5,10,15,20,25]}
criteria = {"strategy": "RandomDiscrete",
"stopping_rounds": 10,
"stopping_tolerance": 0.00001,
"stopping_metric": "misclassification"}
# Grid search and Training
grid_search = H2OGridSearch(model= rf_h, hyper_params= params,
search_criteria = criteria)
grid_search.train(x = features, y = target, training_frame=train,
validation_frame = valid)
# Sorting the grid
sorted_grid = grid_search.get_grid(sort_by='auc', decreasing = True)
Calling grid_search.get_grid(sort_by = 'auc', decreasing = True)
produces the following error:
H2OResponseError: Server error water.exceptions.H2OIllegalArgumentException:
Error: Invalid argument for sort_by specified. Must be one of: [mae, residual_deviance, r2, mean_residual_deviance, rmsle, rmse, mse]
Request: GET /99/Grids/Grid_DRF_py_29_sid_95b5_model_python_1533334963198_8
params: {'sort_by': 'auc', 'decreasing': 'True'}
Looking at the example in the documentation for the grid search I believe that I am using the method correctly.
Edit: Added changing target array to be a factor array from an integer array.