cvSLOPE | R Documentation |
This function trains a model fit by SLOPE()
by tuning its parameters
through cross-validation.
cvSLOPE(
x,
y,
q = 0.2,
gamma = 0,
n_folds = 10,
n_repeats = 1,
measure = c("mse", "mae", "deviance", "misclass", "auc"),
...
)
x |
the design matrix, which can be either a dense matrix of the standard matrix class, or a sparse matrix inheriting from Matrix::sparseMatrix. Data frames will be converted to matrices internally. |
y |
the response, which for |
q |
a vector of quantiles for the |
gamma |
relaxation parameter for SLOPE. Default is |
n_folds |
number of folds (cross-validation) |
n_repeats |
number of folds (cross-validation) |
measure |
DEPRECATED |
... |
other arguments to pass on to |
An object of class "TrainedSLOPE"
, with the following slots:
summary |
a summary of the results with means, standard errors, and 0.95 confidence levels |
data |
the raw data from the model training |
optima |
a |
measure |
a |
call |
the call |
plot.TrainedSLOPE()
Other model-tuning:
plot.TrainedSLOPE()
,
trainSLOPE()
# 8-fold cross-validation
tune <- cvSLOPE(
subset(mtcars, select = c("mpg", "drat", "wt")),
mtcars$hp,
q = c(0.1, 0.2),
n_folds = 8,
n_repeats = 2,
measure = "mse"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.