Regression Bayesian Gaussian Process Learner
Source:R/learner_tgp_regr_bgp.R
mlr_learners_regr.bgp.RdBayesian Gaussian process regression.
Calls tgp::bgp() from tgp.
For the predicted mean ZZ.km and for the predicted variance ZZ.ks2 are chosen.
Meta Information
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, tgp
Parameters
| Id | Type | Default | Levels | Range |
| bprior | character | bflat | b0, b0not, bflat, bmle, bmznot, bmzt | - |
| BTE | untyped | c(1000L, 4000L, 2L) | - | |
| corr | character | expsep | exp, expsep, matern, sim | - |
| Ds2x | logical | FALSE | TRUE, FALSE | - |
| improv | logical | FALSE | TRUE, FALSE | - |
| itemps | untyped | NULL | - | |
| krige | logical | TRUE | TRUE, FALSE | - |
| m0r1 | logical | TRUE | TRUE, FALSE | - |
| MAP | logical | TRUE | TRUE, FALSE | - |
| meanfn | character | linear | constant, linear | - |
| nu | numeric | 1.5 | \((-\infty, \infty)\) | |
| R | integer | 1 | \([1, \infty)\) | |
| sens.p | untyped | NULL | - | |
| trace | logical | FALSE | TRUE, FALSE | - |
| verb | integer | - | \([0, 4]\) | |
| zcov | logical | FALSE | TRUE, FALSE | - |
References
Gramacy RB (2007). “tgp: An R Package for Bayesian Nonstationary, Semiparametric Nonlinear Regression and Design by Treed Gaussian Process Models.” Journal of Statistical Software, 19(9), 1–46. doi:10.18637/jss.v019.i09 .
Gramacy RB, Taddy M (2010). “Categorical Inputs, Sensitivity Analysis, Optimization and Importance Tempering with tgp Version 2, an R Package for Treed Gaussian Process Models.” Journal of Statistical Software, 33(6), 1–48. doi:10.18637/jss.v033.i06 .
See also
as.data.table(mlr_learners)for a table of available Learners in the running session (depending on the loaded packages).Chapter in the mlr3book: https://mlr3book.mlr-org.com/basics.html#learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Super classes
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBgp
Methods
Inherited methods
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()
Examples
# Define the Learner
learner = lrn("regr.bgp")
print(learner)
#>
#> ── <LearnerRegrBgp> (regr.bgp): Bayesian Gaussian Process ──────────────────────
#> • Model: -
#> • Parameters: verb=0
#> • Packages: mlr3, mlr3extralearners, and tgp
#> • Predict Types: [response] and se
#> • Feature Types: integer and numeric
#> • Encapsulation: none (fallback: -)
#> • Properties:
#> • Other settings: use_weights = 'error'
# 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)
#>
#> This is a 'tgp' class object.
#> It is basically a list with the following entries:
#>
#> [1] X n d Z nn Xsplit BTE R
#> [9] linburn g dparams itemps bimprov Zp.mean Zp.km Zp.vark
#> [17] Zp.q Zp.s2 Zp.ks2 Zp.q1 Zp.med Zp.q2 ess gpcs
#> [25] response improv parts trees posts params m0r1
#>
#> See ?btgp for an explanation of the individual entries.
#> See plot.tgp and tgp.trees for help with visualization.
#>
#> The $trace field, if it exists, is of class 'tgptraces'
#> and has its own print statement
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> regr.mse
#> 63.27059