Description Usage Arguments Value
Cross validate the entire elastic net procedure to obtain a set of predicted response values for strictly held out data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | cvElasticNet(
nFolds = 10,
nRepeats = 10,
cvFoldIds = NULL,
minFeatureResponseAbsCor = 0,
featureMat,
responseVec,
standardize = TRUE,
standardizeY = FALSE,
fitIntercept = TRUE,
alphaVals = seq(0.2, 1, length = 9),
lambdaVals = NULL,
nFoldsForParamSelection = 10,
nCvRepeats = 10,
nTrainingRuns = 200,
minFeatureFrequencyPctl = 0.95,
cumCorNumPredictors = 10,
useLambdaMin = TRUE,
useOneStdErrRule = FALSE,
id = "",
keepEnResults = FALSE,
useModelYIntercept = FALSE,
verbose = TRUE
)
|
nFolds |
The number of folds used in cross-validation. |
nRepeats |
The number of cross-validation repeats (with different fold assignments). |
cvFoldIds |
An nObs x nReplicates matrix with integer fold identifiers along the columns. |
minFeatureResponseAbsCor |
Minimum absolute correlation between feature and response (used to filter rows of featureMat). |
featureMat |
p x n matrix with input feature vectors along rows. |
responseVec |
n-dimensional response vector to be predicted using a sparse linear combination of input feature vectors specified in featureMat. |
standardize |
Logical flag for feature variable standardization (across observations), passed in to glmnet functions (glmnet documentation: if variables are already in the same units, standardization may not be necessary). |
standardizeY |
Logical flag for response variable standardization across observations. |
fitIntercept |
Logical flag indicating whether intercept term should be fit. |
alphaVals |
a vector of alpha values to be optimized over |
lambdaVals |
a vector of lambda values to be optimized over |
nFoldsForParamSelection |
the number of cross-validation folds to perform |
nTrainingRuns |
number of training runs to perform |
minFeatureFrequencyPctl |
a fractional value (0-1). Features in the x percentile defined by this parameter after the removal of features with zero weights are retained. |
cumCorNumPredictors |
the maximum number of predictors to be returned |
useLambdaMin |
a boolean, whether to use the minimum lambda (lambda.min) from cross-validation as the optimum lambda, if FALSE then the largest value of lambda such that error is within 1 standard error of the minimum (lambda.1se) is used. |
useOneStdErrRule |
Use one standard error rule for model selection, i.e., select smallest model (in terms of number of predictors) for which the estimated error (by cross-validation) is within one standard error of the minimum estimated error. |
id |
a optional string identifier for the EN run |
useModelYIntercept |
A logical value indicating if the model intercept term should be used for prediction of response values held out in each CV fold. |
verbose |
a boolean, whether debugging information should be displayed |
A list with the following elements
cvPred A vector of cross-validation predicted values (averaged over cross validation repeats).
cvPredR The Pearson's correlation between the above vector of predicted response values and the actual response values.
cvPredRsqared The square of the Pearson's correlation between the above vector of predicted response values and the actual response values.
cvMeanSqErr The mean squared error (averaged over the results from nFolds x nRepeats sets of cross-validation predictions).
cvSdMeanSqErr The standard deviation of the above (nFolds x nRepeats) cross validation mean squared error values.
cvPredMat An nObservations x nRepeats matrix with entry i, j indicating cross-validation predicted response for the i-th observation in the j-th cross-validation repeat.
cvMeanSqErrMat An nFolds x nRepeats matrix with entry i, j indicating the the mean cross validation error in the i-th fold of the j-th cross-validation repeat.
cvFoldEnPredictorWts A feature x en-run matrix, with cells indicating the weight associated with a particular feature in a particular elastic net run. (A zero entry indicates that a given feature was not selected in the run associated with the matrix column.)
cvFoldEnPredictorTab A data frame with summary information for predictors selected over cv-fold elastic net runs (selection frequency, average weight, sign of predictor weights).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.