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 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    1   6 225.0 2.76    3 105 20.22  1 3.460
#>  [6,]  0    4   8 360.0 3.21    3 245 15.84  0 3.570
#>  [7,]  0    2   4 146.7 3.69    4  62 20.00  1 3.190
#>  [8,]  0    4   6 167.6 3.92    4 123 18.90  1 3.440
#>  [9,]  0    3   8 275.8 3.07    3 180 18.00  0 3.780
#> [10,]  0    4   8 472.0 2.93    3 205 17.98  0 5.250
#> [11,]  0    4   8 460.0 3.00    3 215 17.82  0 5.424
#> [12,]  0    4   8 440.0 3.23    3 230 17.42  0 5.345
#> [13,]  1    1   4  78.7 4.08    4  66 19.47  1 2.200
#> [14,]  1    2   4  75.7 4.93    4  52 18.52  1 1.615
#> [15,]  0    1   4 120.1 3.70    3  97 20.01  1 2.465
#> [16,]  0    2   8 318.0 2.76    3 150 16.87  0 3.520
#> [17,]  0    2   8 400.0 3.08    3 175 17.05  0 3.845
#> [18,]  1    1   4  79.0 4.08    4  66 18.90  1 1.935
#> [19,]  1    2   4  95.1 3.77    5 113 16.90  1 1.513
#> [20,]  1    4   8 351.0 4.22    5 264 14.50  0 3.170
#> [21,]  1    2   4 121.0 4.11    4 109 18.60  1 2.780
#> 
#> $z
#>  [1] 21.0 21.0 21.4 18.7 18.1 14.3 24.4 17.8 15.2 10.4 10.4 14.7 32.4 30.4 21.5
#> [16] 15.5 19.2 27.3 30.4 15.8 21.4
#> 

# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
#> i = 1 (of 11), d = 145074, its = 17
#> i = 2 (of 11), d = 145074, its = 21
#> i = 3 (of 11), d = 127705, its = 18
#> i = 4 (of 11), d = 5266.84, its = 4
#> i = 5 (of 11), d = 5266.84, its = 4
#> i = 6 (of 11), d = 127705, its = 29
#> i = 7 (of 11), d = 5901.51, its = 5
#> i = 8 (of 11), d = 6427.41, its = 4
#> i = 9 (of 11), d = 127705, its = 28
#> i = 10 (of 11), d = 127705, its = 19
#> i = 11 (of 11), d = 7363.65, its = 5

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