Description Usage Arguments Value See Also Examples
The main cross-validation function to select the best sprinter fit for a path of tuning parameters.
1 2 3 |
x |
An |
y |
A response vector of size |
num_keep |
Number of candidate interactions to keep in Step 2. If |
square |
Indicator of whether squared effects should be fitted in Step 1. Default to be FALSE. |
lambda |
A user specified list of tuning parameter. Default to be NULL, and the program will compute its own |
nlam |
The number of |
lam_min_ratio |
The ratio of the smallest and the largest values in |
nfold |
Number of folds in cross-validation. Default value is 5. If each fold gets too view observation, a warning is thrown and the minimal |
foldid |
A vector of length |
An object of S3 class "sprinter
".
n
The sample size.
p
The number of main effects.
a0
estimate of intercept corresponding to the CV-selected model.
compact
A compact representation of the selected variables. compact
has three columns, with the first two columns representing the indices of a selected variable (main effects with first index = 0), and the last column representing the estimate of coefficients.
fit
The whole glmnet
fit object in Step 3.
fitted
fitted value of response corresponding to the CV-selected model.
lambda
The sequence of lambda
values used.
cvm
The averaged estimated prediction error on the test sets over K folds.
cvsd
The standard error of the estimated prediction error on the test sets over K folds.
foldid
Fold assignment. A vector of length n
.
ibest
The index in lambda
that is chosen by CV.
call
Function call.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.