swag {swag} | R Documentation |
Spare Wrapper AlGorithm (swag)
Description
swag
is used to trains a meta-learning procedure that combines
screening and wrapper methods to find a set of extremely low-dimensional attribute
combinations. swag
works on top of the caret package and proceeds in a
forward-step manner.
Usage
swag(
x,
y,
control = swagControl(),
auto_control = TRUE,
caret_args_dyn = NULL,
...
)
Arguments
x |
A |
y |
A |
control |
see |
auto_control |
A |
caret_args_dyn |
If not null, a function that can modify arguments for
|
... |
Arguments to be passed to |
Details
Currently we expect the user to replace ...
with the arguments one would
use for train
. This requires to know how to use train
function. If ...
is left unspecified, default values of train
are used. But this might lead to unexpected results.
The function caret_args_dyn
is expected to take as a first
argument a list
with all arguments for train
and as a second argument the number of attributes (see examples in the vignette).
More specifically, swag
builds and tests learners starting
from very few attributes until it includes a maximal number of attributes by
increasing the number of attributes at each step. Hence, for each fixed number
of attributes, the algorithm tests various (randomly selected) learners and
picks those with the best performance in terms of training error. Throughout,
the algorithm uses the information coming from the best learners at the previous
step to build and test learners in the following step. In the end, it outputs
a set of strong low-dimensional learners. See Molinari et al. (2020) for
more details.
Value
swag
returns an object of class "swag
". It is a list
with the following components:
x | same as x input |
y | same as y input |
control | the control used (see swagControl ) |
CVs | a list containing cross-validation errors from all trained models |
VarMat | a list containing information about which models are trained |
cv_alpha | a vector of size pmax containing the
cross-validation error at alpha (see swagControl ) |
IDs | a list containing information about trained model
that performs better than corresponding cv_alpha error |
args_caret | arguments used for train |
args_caret_dyn | same as args_caret_dyn input |
Author(s)
Gaetan Bakalli, Samuel Orso and Cesare Miglioli
References
Molinari R, Bakalli G, Guerrier S, Miglioli C, Orso S, Scaillet O (2020). “SWAG: A Wrapper Method for Sparse Learning.” Version 1: 23 June 2020, https://arxiv.org/pdf/2006.12837.pdf.