Skip to contents

Gradient boosting machine learner. Class h2o::h2o.gbm() from package h2o.

H2O Connection

If no running H2O connection is found, the learner will automatically start a local H2O server on 127.0.0.1 via h2o::h2o.init(). If you want to connect to a remote H2O cluster, call h2o::h2o.init() with the appropriate arguments before training or predicting.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.h2o.gbm")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”

  • Feature Types: “integer”, “numeric”, “factor”

  • Required Packages: mlr3, mlr3extralearners, h2o

Parameters

IdTypeDefaultLevelsRange
auto_rebalancelogicalTRUETRUE, FALSE-
build_tree_one_nodelogicalFALSETRUE, FALSE-
categorical_encodingcharacterAUTOAUTO, Enum, OneHotInternal, OneHotExplicit, Binary, Eigen, LabelEncoder, SortByResponse, EnumLimited-
check_constant_responselogicalTRUETRUE, FALSE-
checkpointuntypedNULL-
col_sample_ratenumeric1\([0, 1]\)
col_sample_rate_change_per_levelnumeric1\([0, 2]\)
col_sample_rate_per_treenumeric1\([0, 1]\)
custom_distribution_funcuntypedNULL-
distributioncharactergaussianAUTO, poisson, laplace, tweedie, gaussian, huber, gamma, quantile, custom-
export_checkpoints_diruntypedNULL-
histogram_typecharacterAUTOAUTO, UniformAdaptive, Random, QuantilesGlobal, RoundRobin, UniformRobust-
huber_alphanumeric0.9\([0, 1]\)
ignore_const_colslogicalTRUETRUE, FALSE-
in_training_checkpoints_diruntypedNULL-
in_training_checkpoints_tree_intervalinteger1\([1, \infty)\)
interaction_constraintsuntypedNULL-
learn_ratenumeric0.1\([0, 1]\)
learn_rate_annealingnumeric1\([0, 1]\)
max_abs_leafnode_prednumericInf\([0, \infty)\)
max_depthinteger5\([1, \infty)\)
max_runtime_secsnumeric0\([0, \infty)\)
min_rowsinteger10\([1, \infty)\)
min_split_improvementnumeric1e-05\([0, \infty)\)
monotone_constraintsuntypedNULL-
nbinsinteger20\([1, \infty)\)
nbins_catsinteger1024\([1, \infty)\)
nbins_top_levelinteger1024\([1, \infty)\)
ntreesinteger50\([1, \infty)\)
pred_noise_bandwidthnumeric0\([0, \infty)\)
quantile_alphanumeric0.5\([0, 1]\)
sample_ratenumeric1\([0, 1]\)
score_each_iterationlogicalFALSETRUE, FALSE-
score_tree_intervalinteger0\([0, \infty)\)
seedinteger-1\((-\infty, \infty)\)
stopping_metriccharacterAUTOAUTO, deviance, MSE, RMSE, MAE, RMSLE-
stopping_roundsinteger0\([0, \infty)\)
stopping_tolerancenumeric0.001\([0, \infty)\)
tweedie_powernumeric1.5\([1, 2]\)
verboselogicalFALSETRUE, FALSE-

References

Fryda T, LeDell E, Gill N, Aiello S, Fu A, Candel A, Click C, Kraljevic T, Nykodym T, Aboyoun P, Kurka M, Malohlava M, Poirier S, Wong W (2025). h2o: R Interface for the 'H2O' Scalable Machine Learning Platform. R package version 3.46.0.9, https://github.com/h2oai/h2o-3.

See also

Author

awinterstetter

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrH2OGBM

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrH2OGBM$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = lrn("regr.h2o.gbm")
print(learner)
#> 
#> ── <LearnerRegrH2OGBM> (regr.h2o.gbm): H2O GBM ─────────────────────────────────
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3, mlr3extralearners, and h2o
#> • Predict Types: [response]
#> • Feature Types: integer, numeric, and factor
#> • Encapsulation: none (fallback: -)
#> • Properties: missings and weights
#> • Other settings: use_weights = 'use'

# Define a Task
task = tsk("mtcars")

# Create train and test set
ids = partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)

print(learner$model)
#> Model Details:
#> ==============
#> 
#> H2ORegressionModel: gbm
#> Model ID:  GBM_model_R_1774260318250_110 
#> Model Summary: 
#>   number_of_trees number_of_internal_trees model_size_in_bytes min_depth
#> 1              50                       50                4182         1
#>   max_depth mean_depth min_leaves max_leaves mean_leaves
#> 1         1    1.00000          2          2     2.00000
#> 
#> 
#> H2ORegressionMetrics: gbm
#> ** Reported on training data. **
#> 
#> MSE:  6.430306
#> RMSE:  2.535805
#> MAE:  2.042708
#> RMSLE:  0.1291818
#> Mean Residual Deviance :  6.430306
#> 
#> 
#> 
#> 


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()
#> regr.mse 
#>  13.0992