Description Usage Arguments Details Value Measures Author(s) See Also Examples
This function performs model validation by k-fold cross validation for
models fit with sgdnet()
over the entire regularization path and/or
various elastic net penalties.
1 2 3 |
x |
input matrix |
y |
response variable |
alpha |
elastic net mixing parameter; vectors of values are allowed
(unlike in |
lambda |
regularization strength |
nfolds |
number of folds (k) – 3 is the minimum allowed |
foldid |
a vector of fold identities of the same length as the number of observations |
type.measure |
the type of error, one of ("deviance" (default), "mse" (mean-squared error), "mae" (mean absolute error), "class" (misclassification rate), "auc" (area under the curve)); see Measures to find out what types each family has available. |
... |
arguments passed on to |
The primary usage of this model is to tune for values of lambda
and
alpha
. This function will randomly divide the
data into k folds. For each fold, the remaining k-1 will
be used to train a model across a regularization path, and optionally a
range of alpha
. The fold that is left out
is then used to measure the performance of the model. We proceed across
all the folds, which means that each observation is used exactly once for
validation, and finally average our results across all the folds.
An object of class 'cv_sgdnet'
with the following items:
|
the elastic net mixing parameter used |
|
a list of lambda values of the same length as |
|
a |
|
the raw cross-validation scores as a list of the
same length as |
|
the type of prediction error used |
|
a fit from |
|
the |
|
the |
|
the largest |
Family | deviance | mse | mae | class | auc |
gaussian | x (mse ) | x | x | ||
binomial | x | x | x | x | x |
multinomial | x | x | x | x | |
mgaussian | x (mse ) | x | x |
Johan Larsson (partly consisting of modified code from
glmnet::cv.glmnet()
by Jerome Friedman, Trevor Hastie, Rob Tibshirani,
and Noah Simon)
sgdnet()
, predict.cv_sgdnet()
, plot.cv_sgdnet()
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.