Calling H2O Algorithms¶
- Create the parameters object that holds references to input data and the parameters for the specific algorithm:
val train: RDD = ...
val valid: H2OFrame = ...
val gbmParams = new GBMParameters()
gbmParams._train = train
gbmParams._valid = valid
gbmParams._response_column = "bikes"
gbmParams._ntrees = 500
gbmParams._max_depth = 6
- Create a model builder:
val gbm = new GBM(gbmParams)
- Invoke the model build job and block until the end of computation (
trainModel
is an asynchronous call by default):
val gbmModel = gbm.trainModel.get