Skip to contents

Tree-boosting combined with Gaussian process and grouped random effects models. Calls gpboost::gpb.train() from gpboost.

The random effects model is specified with the custom parameters group_data_cols and gp_coords_cols. If neither is set, a plain gradient boosting model is fitted. The boosting parameters are documented here and in the documentation of gpboost::gpb.train(). The parameters of the random effects model are documented in gpboost::GPModel().

Custom mlr3 parameters

  • group_data_cols: Names of features that define grouped random effects, one random intercept per column. The columns are passed to gpboost::GPModel() as group_data and are excluded from the tree features.

  • gp_coords_cols: Names of numeric features that are the coordinates of a Gaussian process. The columns are passed to gpboost::GPModel() as gp_coords and are excluded from the tree features.

  • seed is passed to the boosting algorithm and to gpboost::GPModel().

  • nrounds sets the number of boosting iterations. The alias num_iterations is not available.

  • Observation weights are passed to gpboost::GPModel() if a random effects model is used and to gpboost::gpb.Dataset() otherwise.

  • The predict type "se" returns the square root of the predictive variance and requires a random effects model.

Initial parameter values

  • num_threads is initialized to 1 to avoid conflicts with parallelization via future.

  • verbose is initialized to -1 to suppress the output of GPBoost.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.gpboost")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”, “se”

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

  • Required Packages: mlr3, mlr3extralearners, gpboost

Parameters

IdTypeDefaultLevelsRange
group_data_colsuntyped--
gp_coords_colsuntyped--
nroundsinteger100\([1, \infty)\)
verboseinteger1\((-\infty, \infty)\)
recordlogicalTRUETRUE, FALSE-
reset_datalogicalFALSETRUE, FALSE-
use_gp_model_for_validationlogicalTRUETRUE, FALSE-
train_gp_model_cov_parslogicalTRUETRUE, FALSE-
likelihooduntyped"gaussian"-
cov_functionuntyped"matern"-
cov_fct_shapenumeric1.5\([0, \infty)\)
cov_fct_orderinteger1\([1, 2]\)
gp_approxcharacternonenone, vecchia, full_scale_vecchia, tapering, fitc, full_scale_tapering, vecchia_latent-
num_parallel_threadsintegerNULL\([1, \infty)\)
GPU_uselogicalFALSETRUE, FALSE-
matrix_inversion_methodcharacterdefaultdefault, cholesky, iterative-
likelihood_learning_ratenumeric1\([0, \infty)\)
cov_fct_taper_rangenumeric1\([0, \infty)\)
cov_fct_taper_shapenumeric1\([0, \infty)\)
num_neighborsintegerNULL\([1, \infty)\)
vecchia_orderingcharacterrandomnone, random, time, time_random_space-
ind_points_selectioncharacterkmeans++kmeans++, cover_tree, random-
num_ind_pointsintegerNULL\([1, \infty)\)
cover_tree_radiusnumeric1\([0, \infty)\)
likelihood_additional_paramnumericNULL\((-\infty, \infty)\)
fidelity_specific_meanlogicalTRUETRUE, FALSE-
objectivecharactergaussiangaussian, regression, regression_l1, huber, fair, poisson, quantile, mape, gamma, tweedie, [...]-
boostingcharactergbdtgbdt-
learning_ratenumeric0.1\([0, \infty)\)
num_leavesinteger31\([2, 131072]\)
tree_learnercharacterserialserial, feature, data, voting-
num_threadsinteger0\([0, \infty)\)
device_typecharactercpucpu, gpu-
seedinteger-\((-\infty, \infty)\)
deterministiclogicalFALSETRUE, FALSE-
line_search_step_lengthlogicalFALSETRUE, FALSE-
reuse_learning_rates_gp_modellogicalTRUETRUE, FALSE-
leaves_newton_updatelogicalFALSETRUE, FALSE-
use_nesterov_acclogicalFALSETRUE, FALSE-
nesterov_acc_ratenumeric0.5\([0, \infty)\)
momentum_offsetinteger0\([0, \infty)\)
momentum_schedule_versioninteger1\([0, 1]\)
linear_treelogicalFALSETRUE, FALSE-
force_col_wiselogicalFALSETRUE, FALSE-
force_row_wiselogicalFALSETRUE, FALSE-
histogram_pool_sizenumeric-1\((-\infty, \infty)\)
max_depthinteger-1\((-\infty, \infty)\)
min_data_in_leafinteger20\([0, \infty)\)
min_sum_hessian_in_leafnumeric0.001\([0, \infty)\)
bagging_fractionnumeric1\([0, 1]\)
bagging_freqinteger0\([0, \infty)\)
bagging_seedinteger3\((-\infty, \infty)\)
feature_fractionnumeric1\([0, 1]\)
feature_fraction_bynodenumeric1\([0, 1]\)
feature_fraction_seedinteger2\((-\infty, \infty)\)
extra_treeslogicalFALSETRUE, FALSE-
extra_seedinteger6\((-\infty, \infty)\)
first_metric_onlylogicalFALSETRUE, FALSE-
max_delta_stepnumeric0\((-\infty, \infty)\)
lambda_l1numeric0\([0, \infty)\)
lambda_l2numeric0\([0, \infty)\)
linear_lambdanumeric0\([0, \infty)\)
min_gain_to_splitnumeric0\([0, \infty)\)
drop_ratenumeric0.1\([0, 1]\)
max_dropinteger50\((-\infty, \infty)\)
skip_dropnumeric0.5\([0, 1]\)
xgboost_dart_modelogicalFALSETRUE, FALSE-
uniform_droplogicalFALSETRUE, FALSE-
drop_seedinteger4\((-\infty, \infty)\)
top_ratenumeric0.2\([0, 1]\)
other_ratenumeric0.1\([0, 1]\)
min_data_per_groupinteger100\([1, \infty)\)
max_cat_thresholdinteger32\([1, \infty)\)
cat_l2numeric10\([0, \infty)\)
cat_smoothnumeric10\([0, \infty)\)
max_cat_to_onehotinteger4\([1, \infty)\)
top_kinteger20\([1, \infty)\)
monotone_constraintsuntypedNULL-
monotone_constraints_methodcharacterbasicbasic, intermediate, advanced-
monotone_penaltynumeric0\([0, \infty)\)
feature_contriuntypedNULL-
forcedsplits_filenameuntyped""-
refit_decay_ratenumeric0.9\([0, 1]\)
cegb_tradeoffnumeric1\([0, \infty)\)
cegb_penalty_splitnumeric0\([0, \infty)\)
cegb_penalty_feature_lazyuntyped--
cegb_penalty_feature_coupleduntyped--
path_smoothnumeric0\([0, \infty)\)
interaction_constraintsuntyped--
max_bininteger255\([2, \infty)\)
max_bin_by_featureuntypedNULL-
min_data_in_bininteger3\([1, \infty)\)
bin_construct_sample_cntinteger200000\([1, \infty)\)
data_random_seedinteger1\((-\infty, \infty)\)
is_enable_sparselogicalTRUETRUE, FALSE-
enable_bundlelogicalTRUETRUE, FALSE-
use_missinglogicalTRUETRUE, FALSE-
zero_as_missinglogicalFALSETRUE, FALSE-
feature_pre_filterlogicalFALSETRUE, FALSE-
pre_partitionlogicalFALSETRUE, FALSE-
two_roundlogicalFALSETRUE, FALSE-
forcedbins_filenameuntyped""-
boost_from_averagelogicalTRUETRUE, FALSE-
reg_sqrtlogicalFALSETRUE, FALSE-
alphanumeric0.9\([0, \infty)\)
fair_cnumeric1\([0, \infty)\)
poisson_max_delta_stepnumeric0.7\([0, \infty)\)
tweedie_variance_powernumeric1.5\([1, 2]\)
sigmanumeric1\([0, \infty)\)
ylnumeric-Inf\((-\infty, \infty)\)
yunumericInf\((-\infty, \infty)\)
num_machinesinteger1\([1, \infty)\)
local_listen_portinteger12400\([1, \infty)\)
time_outinteger120\([1, \infty)\)
machinesuntyped""-
gpu_platform_idinteger-1\((-\infty, \infty)\)
gpu_device_idinteger-1\((-\infty, \infty)\)
gpu_use_dplogicalFALSETRUE, FALSE-
num_gpuinteger1\([1, \infty)\)
start_iterationintegerNULL\([0, \infty)\)
num_iterationintegerNULL\([1, \infty)\)
ignore_gp_modellogicalFALSETRUE, FALSE-
vecchia_pred_typecharacterNULLorder_obs_first_cond_obs_only, order_obs_first_cond_all, latent_order_obs_first_cond_obs_only, latent_order_obs_first_cond_all, order_pred_first-
num_neighbors_predintegerNULL\([1, \infty)\)

References

Sigrist, Fabio (2022). “Gaussian Process Boosting.” Journal of Machine Learning Research, 23(232), 1–46. http://jmlr.org/papers/v23/20-322.html.

See also

Author

floriandl

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGPBoost

Active bindings

marshaled

(logical(1)) Whether the learner has been marshaled.

Methods

Inherited methods


LearnerRegrGPBoost$new()

Creates a new instance of this R6 class.

Usage


LearnerRegrGPBoost$importance()

The importance scores are extracted with gpboost::gpb.importance() and correspond to the total gain of the splits of a feature. Features without splits and the columns of the random effects model get an importance of 0.

Usage

LearnerRegrGPBoost$importance()

Returns

Named numeric().


LearnerRegrGPBoost$marshal()

Marshal the learner's model.

Usage

LearnerRegrGPBoost$marshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::marshal_model().


LearnerRegrGPBoost$unmarshal()

Unmarshal the learner's model.

Usage

LearnerRegrGPBoost$unmarshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::unmarshal_model().


LearnerRegrGPBoost$clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrGPBoost$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner with a random intercept for the number of cylinders
learner = lrn("regr.gpboost", group_data_cols = "cyl", min_data_in_leaf = 5L, predict_type = "se")
print(learner)
#> 
#> ── <LearnerRegrGPBoost> (regr.gpboost): Gaussian Process Boosting ──────────────
#> • Model: -
#> • Parameters: group_data_cols=cyl, verbose=-1, num_threads=1,
#> min_data_in_leaf=5
#> • Packages: mlr3, mlr3extralearners, and gpboost
#> • Predict Types: response and [se]
#> • Feature Types: logical, integer, numeric, factor, and ordered
#> • Encapsulation: none (fallback: -)
#> • Properties: importance, marshal, missings, and weights
#> • Other settings: use_weights = 'use', predict_raw = 'FALSE'

# 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)
#> [GPBoost] [Info] GPBoost is using 1 OpenMP thread by default for parallel computations. Run gpb.tune.num.threads() to benchmark different numbers of threads and to select a tuned default for this session. For the best performance, try different values of 'num_parallel_threads' on the 'GPModel' you are using.

print(learner$importance())
#>         wt       qsec       drat       carb         am        cyl       disp 
#> 0.59971312 0.28254556 0.06181478 0.05592654 0.00000000 0.00000000 0.00000000 
#>       gear         hp         vs 
#> 0.00000000 0.00000000 0.00000000 

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

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