Skip to contents

Local 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.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.laGP")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”, “se”

  • Feature Types: “integer”, “numeric”

  • Required Packages: mlr3, mlr3extralearners, laGP

Parameters

IdTypeDefaultLevelsRange
startinteger6\([6, \infty)\)
endinteger50\([6, \infty)\)
duntypedNULL-
guntyped1/10000-
methodcharacteralcalc, alcray, efi, mspe, nn-
closeinteger-\([0, \infty)\)
numraysinteger-\([0, \infty)\)
verbnumeric0\((-\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

Author

awinterstetter

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrLaGP

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

LearnerRegrLaGP$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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 16.46  0 2.620
#>  [2,]  1    1   4 108.0 3.85    4  93 18.61  1 2.320
#>  [3,]  0    2   8 360.0 3.15    3 175 17.02  0 3.440
#>  [4,]  0    1   6 225.0 2.76    3 105 20.22  1 3.460
#>  [5,]  0    2   4 140.8 3.92    4  95 22.90  1 3.150
#>  [6,]  0    4   6 167.6 3.92    4 123 18.30  1 3.440
#>  [7,]  0    4   6 167.6 3.92    4 123 18.90  1 3.440
#>  [8,]  0    4   8 472.0 2.93    3 205 17.98  0 5.250
#>  [9,]  0    4   8 440.0 3.23    3 230 17.42  0 5.345
#> [10,]  1    2   4  75.7 4.93    4  52 18.52  1 1.615
#> [11,]  1    1   4  71.1 4.22    4  65 19.90  1 1.835
#> [12,]  0    1   4 120.1 3.70    3  97 20.01  1 2.465
#> [13,]  0    2   8 304.0 3.15    3 150 17.30  0 3.435
#> [14,]  0    4   8 350.0 3.73    3 245 15.41  0 3.840
#> [15,]  0    2   8 400.0 3.08    3 175 17.05  0 3.845
#> [16,]  1    1   4  79.0 4.08    4  66 18.90  1 1.935
#> [17,]  1    2   4 120.3 4.43    5  91 16.70  0 2.140
#> [18,]  1    2   4  95.1 3.77    5 113 16.90  1 1.513
#> [19,]  1    4   8 351.0 4.22    5 264 14.50  0 3.170
#> [20,]  1    6   6 145.0 3.62    5 175 15.50  0 2.770
#> [21,]  1    8   8 301.0 3.54    5 335 14.60  0 3.570
#> 
#> $z
#>  [1] 21.0 22.8 18.7 18.1 22.8 19.2 17.8 10.4 14.7 30.4 33.9 21.5 15.2 13.3 19.2
#> [16] 27.3 26.0 30.4 15.8 19.7 15.0
#> 

# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
#> i = 1 (of 11), d = 5551.92, its = 5
#> i = 2 (of 11), d = 3189.93, its = 4
#> i = 3 (of 11), d = 23392.1, its = 9
#> i = 4 (of 11), d = 5551.92, its = 5
#> i = 5 (of 11), d = 80816.2, its = 22
#> i = 6 (of 11), d = 80816.2, its = 22
#> i = 7 (of 11), d = 80816.2, its = 22
#> i = 8 (of 11), d = 23392.1, its = 9
#> i = 9 (of 11), d = 5551.92, its = 5
#> i = 10 (of 11), d = 23392.1, its = 9
#> i = 11 (of 11), d = 5551.92, its = 5

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