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', 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,]  1    1   4 108.0 3.85    4  93 18.61  1 2.320
#>  [4,]  0    1   6 258.0 3.08    3 110 19.44  1 3.215
#>  [5,]  0    2   8 360.0 3.15    3 175 17.02  0 3.440
#>  [6,]  0    1   6 225.0 2.76    3 105 20.22  1 3.460
#>  [7,]  0    4   8 360.0 3.21    3 245 15.84  0 3.570
#>  [8,]  0    2   4 140.8 3.92    4  95 22.90  1 3.150
#>  [9,]  0    4   6 167.6 3.92    4 123 18.90  1 3.440
#> [10,]  0    3   8 275.8 3.07    3 180 17.40  0 4.070
#> [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    1   4  71.1 4.22    4  65 19.90  1 1.835
#> [15,]  0    2   8 318.0 2.76    3 150 16.87  0 3.520
#> [16,]  0    2   8 304.0 3.15    3 150 17.30  0 3.435
#> [17,]  0    4   8 350.0 3.73    3 245 15.41  0 3.840
#> [18,]  0    2   8 400.0 3.08    3 175 17.05  0 3.845
#> [19,]  1    2   4  95.1 3.77    5 113 16.90  1 1.513
#> [20,]  1    6   6 145.0 3.62    5 175 15.50  0 2.770
#> [21,]  1    2   4 121.0 4.11    4 109 18.60  1 2.780
#> 
#> $z
#>  [1] 21.0 21.0 22.8 21.4 18.7 18.1 14.3 22.8 17.8 16.4 10.4 14.7 32.4 33.9 15.5
#> [16] 15.2 13.3 19.2 30.4 19.7 21.4
#> 

# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
#> i = 1 (of 11), d = 5133.12, its = 5
#> i = 2 (of 11), d = 5133.12, its = 5
#> i = 3 (of 11), d = 8269.96, its = 5
#> i = 4 (of 11), d = 7980.28, its = 5
#> i = 5 (of 11), d = 8846.03, its = 5
#> i = 6 (of 11), d = 5133.12, its = 5
#> i = 7 (of 11), d = 5133.12, its = 5
#> i = 8 (of 11), d = 5133.12, its = 5
#> i = 9 (of 11), d = 5133.12, its = 5
#> i = 10 (of 11), d = 9645.28, its = 4
#> i = 11 (of 11), d = 8846.03, its = 5

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