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


LearnerRegrLaGP$new()

Creates a new instance of this R6 class.

Usage


LearnerRegrLaGP$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', 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)

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    4   6 160.0 3.90    4 110 17.02  0 2.875
#>  [3,]  0    1   6 225.0 2.76    3 105 20.22  1 3.460
#>  [4,]  0    2   4 140.8 3.92    4  95 22.90  1 3.150
#>  [5,]  0    4   6 167.6 3.92    4 123 18.30  1 3.440
#>  [6,]  0    4   6 167.6 3.92    4 123 18.90  1 3.440
#>  [7,]  0    3   8 275.8 3.07    3 180 17.40  0 4.070
#>  [8,]  0    3   8 275.8 3.07    3 180 17.60  0 3.730
#>  [9,]  0    4   8 472.0 2.93    3 205 17.98  0 5.250
#> [10,]  0    4   8 460.0 3.00    3 215 17.82  0 5.424
#> [11,]  1    1   4  78.7 4.08    4  66 19.47  1 2.200
#> [12,]  1    2   4  75.7 4.93    4  52 18.52  1 1.615
#> [13,]  0    2   8 318.0 2.76    3 150 16.87  0 3.520
#> [14,]  0    2   8 304.0 3.15    3 150 17.30  0 3.435
#> [15,]  0    4   8 350.0 3.73    3 245 15.41  0 3.840
#> [16,]  0    2   8 400.0 3.08    3 175 17.05  0 3.845
#> [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    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 21.0 18.1 22.8 19.2 17.8 16.4 17.3 10.4 10.4 32.4 30.4 15.5 15.2 13.3
#> [16] 19.2 27.3 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 = 174260, its = 20
#> i = 2 (of 11), d = 180503, its = 37
#> i = 3 (of 11), d = 20978.8, its = 6
#> i = 4 (of 11), d = 23001.5, its = 5
#> i = 5 (of 11), d = 180503, its = 38
#> i = 6 (of 11), d = 34986.2, its = 20
#> i = 7 (of 11), d = 20978.8, its = 6
#> i = 8 (of 11), d = 174260, its = 20
#> i = 9 (of 11), d = 179858, its = 18
#> i = 10 (of 11), d = 180503, its = 36
#> i = 11 (of 11), d = 180503, its = 36

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