SelectionAlgo {sharp} | R Documentation |
Variable selection algorithm
Description
Runs the variable selection algorithm specified in the argument
implementation
. This function is not using stability.
Usage
SelectionAlgo(
xdata,
ydata = NULL,
Lambda,
group_x = NULL,
scale = TRUE,
family = NULL,
implementation = PenalisedRegression,
...
)
Arguments
xdata |
matrix of predictors with observations as rows and variables as columns. |
ydata |
optional vector or matrix of outcome(s). If |
Lambda |
matrix of parameters controlling the level of sparsity in the
underlying feature selection algorithm specified in |
group_x |
vector encoding the grouping structure among predictors. This
argument indicates the number of variables in each group. Only used for
models with group penalisation (e.g. |
scale |
logical indicating if the predictor data should be scaled. |
family |
type of regression model. This argument is defined as in
|
implementation |
function to use for variable selection. Possible
functions are: |
... |
additional parameters passed to the function provided in
|
Value
A list with:
selected |
matrix of binary selection status. Rows correspond to different model parameters. Columns correspond to predictors. |
beta_full |
array of model coefficients. Rows correspond to different model parameters. Columns correspond to predictors. Indices along the third dimension correspond to outcome variable(s). |
See Also
VariableSelection
, PenalisedRegression
,
SparsePCA
, SparsePLS
, GroupPLS
,
SparseGroupPLS
Other wrapping functions:
GraphicalAlgo()
Examples
# Data simulation (univariate outcome)
set.seed(1)
simul <- SimulateRegression(pk = 50)
# Running the LASSO
mylasso <- SelectionAlgo(
xdata = simul$xdata, ydata = simul$ydata,
Lambda = c(0.1, 0.2), family = "gaussian",
)
# Data simulation (multivariate outcome)
set.seed(1)
simul <- SimulateRegression(pk = 50, q = 3)
# Running multivariate Gaussian LASSO
mylasso <- SelectionAlgo(
xdata = simul$xdata, ydata = simul$ydata,
Lambda = c(0.1, 0.2), family = "mgaussian"
)
str(mylasso)