stack_rwnn {RWNN} | R Documentation |
Use stacking to create ensemble random weight neural networks.
stack_rwnn(
formula,
data = NULL,
n_hidden = c(),
lambda = NULL,
B = 100,
optimise = FALSE,
folds = 10,
method = NULL,
type = NULL,
control = list()
)
## S3 method for class 'formula'
stack_rwnn(
formula,
data = NULL,
n_hidden = c(),
lambda = NULL,
B = 100,
optimise = FALSE,
folds = 10,
method = NULL,
type = NULL,
control = list()
)
formula |
A formula specifying features and targets used to estimate the parameters of the output layer. |
data |
A data-set (either a data.frame or a tibble) used to estimate the parameters of the output layer. |
A vector of integers designating the number of neurons in each of the hidden layers (the length of the list is taken as the number of hidden layers). | |
lambda |
The penalisation constant(s) passed to either rwnn or ae_rwnn (see |
B |
The number of models in the stack. |
optimise |
TRUE/FALSE: Should the stacking weights be optimised (or should the stack just predict the average)? |
folds |
The number of folds used when optimising the stacking weights (see |
method |
The penalisation type passed to ae_rwnn. Set to |
type |
A string indicating whether this is a regression or classification problem. |
control |
A list of additional arguments passed to the control_rwnn function. |
An ERWNN-object.
Wolpert D. (1992) "Stacked generalization." Neural Networks, 5, 241-259.
Breiman L. (1996) "Stacked regressions." Machine Learning, 24, 49-64.
n_hidden <- c(20, 15, 10, 5)
lambda <- 0.01
B <- 100
## Using the average of the stack to predict new targets
m <- stack_rwnn(y ~ ., data = example_data, n_hidden = n_hidden,
lambda = lambda, B = B)
## Using the optimised weighting of the stack to predict new targets
m <- stack_rwnn(y ~ ., data = example_data, n_hidden = n_hidden,
lambda = lambda, B = B, optimise = TRUE)