pythonmachine-learningh2oautomlh2o.ai

Get accuracy metric from leaderboard function when using H20 AI


I am running a binary classification model using H2O autoML. I have explicitly told autoML to treat this as a classification model with the following line of code.

# This line of code turns our int variable into a factor.
# This is necessary to tell H2O that we want a classification model
feature_data['Radius'] = feature_data['Radius'].asfactor()

After running H20 autoML for a minute and then using the following line of code;

lb = aml.leaderboard
lb.head()
lb.head(rows=lb.nrows) # Entire leaderboard

I got the output in the screenshot below Leaderboard output

As you can see, the metrics used for classification are AUC and logloss but what I want to see is accuracy. What should I add to get such an output?


Solution

  • It doesn't look like the leaderboard allows you to sort using accuracy as a metric. The following lines of code and text have been directly taken from the documentation:

    aml = H2OAutoML(max_runtime_secs = 30, sort_metric = "logloss")
    

    For binomial classification choose between AUC, "logloss", "mean_per_class_error", "RMSE", "MSE".