StackedModel: Stacked Regression Model

Description Usage Arguments Details Value References See Also Examples

View source: R/ML_StackedModel.R

Description

Fit a stacked regression model from multiple base learners.

Usage

1
StackedModel(..., control = MachineShop::settings("control"), weights = NULL)

Arguments

...

model functions, function names, objects, or vector of these to serve as base learners.

control

control function, function name, or object defining the resampling method to be employed for the estimation of base learner weights.

weights

optional fixed base learner weights.

Details

Response Types:

factor, numeric, ordered, Surv

Value

StackedModel class object that inherits from MLModel.

References

Breiman, L. (1996). Stacked regression. Machine Learning, 24, 49-64.

See Also

fit, resample

Examples

1
2
3
4
5
## Requires prior installation of suggested packages gbm and glmnet to run

model <- StackedModel(GBMModel, SVMRadialModel, GLMNetModel(lambda = 0.01))
model_fit <- fit(sale_amount ~ ., data = ICHomes, model = model)
predict(model_fit, newdata = ICHomes)

MachineShop documentation built on Oct. 1, 2021, 5:06 p.m.