Download our e-book of Introduction To Python
Pallavi Parekh
3 years ago
import h2o
from h2o.automl import H2OAutoML
h2o.init()
data = h2o.import_file('iris.csv')
features = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width']
output = 'class'
train, test = data.split_frame(ratios=[0.8])
aml = H2OAutoML(max_models = 30, max_runtime_secs=300, seed = 1)
aml.train(x = features, y = output, training_frame = train)
lb = aml.leaderboard
lb.head()
print (preds)
lb.head(rows = lb.nrows)