Learn R Programming

SPOT (version 2.1.10)

buildEnsembleStack: Ensemble: Stacking

Description

Generates an ensemble of surrogate models with stacking (stacked generalization).

Usage

buildEnsembleStack(x, y, control = list())

Arguments

x

design matrix (sample locations), rows for each sample, columns for each variable.

y

vector of observations at x

control

(list), with the options for the model building procedure: modelL1 Function for fitting the L1 model (default: buildLM) which combines the results of the L0 models. modelL1Control List of control parameters for the L1 model (default: list()). modelL0 A list of functions for fitting the L0 models (default: list(buildLM,buildRandomForest,buildKriging)). modelL0Control List of control lists for each L0 model (default: list(list(),list(),list())).

Value

returns an object of class ensembleStack.

References

Bartz-Beielstein, Thomas. Stacked Generalization of Surrogate Models-A Practical Approach. Technical Report 5/2016, TH Koeln, Koeln, 2016.

David H Wolpert. Stacked generalization. Neural Networks, 5(2):241-259, January 1992.

See Also

predict.ensembleStack

Examples

Run this code
# NOT RUN {
## Create a test function: branin
braninFunction <- function (x) {	
	(x[2]  - 5.1/(4 * pi^2) * (x[1] ^2) + 5/pi * x[1]  - 6)^2 + 
10 * (1 - 1/(8 * pi)) * cos(x[1] ) + 10
}
## Create design points
x <- cbind(runif(20)*15-5,runif(20)*15)
## Compute observations at design points
y <- as.matrix(apply(x,1,braninFunction))
## Create model with default settings
fit <- buildEnsembleStack(x,y)
## Predict new point
predict(fit,cbind(1,2))
## True value at location
braninFunction(c(1,2))

# }

Run the code above in your browser using DataLab