Ensemble {sharp} | R Documentation |
Ensemble model
Description
Creates an ensemble predictive model from VariableSelection
outputs.
Usage
Ensemble(stability, xdata, ydata)
Arguments
stability |
output of |
xdata |
matrix of predictors with observations as rows and variables as columns. |
ydata |
optional vector or matrix of outcome(s). If |
Value
An object of class ensemble_model
. A list with:
intercept |
a vector of refitted intercepts for the |
beta |
a matrix of beta coefficients from the
|
models |
a list of |
family |
type of regression, extracted from
|
See Also
Other ensemble model functions:
EnsemblePredictions()
Examples
# Linear regression
set.seed(1)
simul <- SimulateRegression(n = 100, pk = 50, family = "gaussian")
stab <- VariableSelection(xdata = simul$xdata, ydata = simul$ydata, family = "gaussian")
ensemble <- Ensemble(stability = stab, xdata = simul$xdata, ydata = simul$ydata)
# Logistic regression
set.seed(1)
simul <- SimulateRegression(n = 200, pk = 20, family = "binomial")
stab <- VariableSelection(xdata = simul$xdata, ydata = simul$ydata, family = "binomial")
ensemble <- Ensemble(stability = stab, xdata = simul$xdata, ydata = simul$ydata)