Regression Local Approximate Gaussian Process Learner
Source:R/learner_laGP_regr_laGP.R
mlr_learners_regr.laGP.RdLocal approximate Gaussian process for regression.
Calls laGP::aGP() from laGP.
Note
Parameters start and end tune the initial and maximum neighborhood sizes
used for the local GP fit, d can fix the length-scale parameters, g
configures the nugget/regularization term, and method selects the search
heuristic (alc, alcray, efi, mspe, nn). Arguments close and
numrays further refine the ray-based search used by method = "alcray",
while verb controls the output verbosity.
Meta Information
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, laGP
Parameters
| Id | Type | Default | Levels | Range |
| start | integer | 6 | \([6, \infty)\) | |
| end | integer | 50 | \([6, \infty)\) | |
| d | untyped | NULL | - | |
| g | untyped | 1/10000 | - | |
| method | character | alc | alc, alcray, efi, mspe, nn | - |
| close | integer | - | \([0, \infty)\) | |
| numrays | integer | - | \([0, \infty)\) | |
| verb | numeric | 0 | \((-\infty, \infty)\) |
References
Gramacy, B. R (2016). “laGP: Large-Scale Spatial Modeling via Local Approximate Gaussian Processes in R.” Journal of Statistical Software, 72(1), 1–46. doi:10.18637/jss.v072.i01 .
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 -> LearnerRegrLaGP
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 (use a small neighborhood size for this task)
learner = lrn("regr.laGP", end = 15)
print(learner)
#>
#> ── <LearnerRegrLaGP> (regr.laGP): Local Approximate Gaussian Process ───────────
#> • Model: -
#> • Parameters: end=15
#> • Packages: mlr3, mlr3extralearners, and laGP
#> • 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)
#> $x
#> am carb cyl disp drat gear hp qsec vs wt
#> [1,] 1 4 6 160.0 3.90 4 110 17.02 0 2.875
#> [2,] 1 1 4 108.0 3.85 4 93 18.61 1 2.320
#> [3,] 0 1 6 258.0 3.08 3 110 19.44 1 3.215
#> [4,] 0 2 8 360.0 3.15 3 175 17.02 0 3.440
#> [5,] 0 4 8 360.0 3.21 3 245 15.84 0 3.570
#> [6,] 0 2 4 146.7 3.69 4 62 20.00 1 3.190
#> [7,] 0 2 4 140.8 3.92 4 95 22.90 1 3.150
#> [8,] 0 3 8 275.8 3.07 3 180 17.60 0 3.730
#> [9,] 0 3 8 275.8 3.07 3 180 18.00 0 3.780
#> [10,] 0 4 8 460.0 3.00 3 215 17.82 0 5.424
#> [11,] 0 4 8 440.0 3.23 3 230 17.42 0 5.345
#> [12,] 1 1 4 71.1 4.22 4 65 19.90 1 1.835
#> [13,] 0 1 4 120.1 3.70 3 97 20.01 1 2.465
#> [14,] 0 2 8 318.0 2.76 3 150 16.87 0 3.520
#> [15,] 0 2 8 304.0 3.15 3 150 17.30 0 3.435
#> [16,] 0 4 8 350.0 3.73 3 245 15.41 0 3.840
#> [17,] 1 1 4 79.0 4.08 4 66 18.90 1 1.935
#> [18,] 1 2 4 95.1 3.77 5 113 16.90 1 1.513
#> [19,] 1 6 6 145.0 3.62 5 175 15.50 0 2.770
#> [20,] 1 8 8 301.0 3.54 5 335 14.60 0 3.570
#> [21,] 1 2 4 121.0 4.11 4 109 18.60 1 2.780
#>
#> $z
#> [1] 21.0 22.8 21.4 18.7 14.3 24.4 22.8 17.3 15.2 10.4 14.7 33.9 21.5 15.5 15.2
#> [16] 13.3 27.3 30.4 19.7 15.0 21.4
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
#> i = 1 (of 11), d = 18065.4, its = 10
#> i = 2 (of 11), d = 26947.8, its = 5
#> i = 3 (of 11), d = 18071.4, its = 8
#> i = 4 (of 11), d = 18071.4, its = 8
#> i = 5 (of 11), d = 34174.4, its = 23
#> i = 6 (of 11), d = 34604.5, its = 21
#> i = 7 (of 11), d = 18071.4, its = 8
#> i = 8 (of 11), d = 18071.4, its = 8
#> i = 9 (of 11), d = 34604.5, its = 20
#> i = 10 (of 11), d = 18071.4, its = 8
#> i = 11 (of 11), d = 34604.5, its = 18
# Score the predictions
predictions$score()
#> regr.mse
#> 18.5116