Description Usage Arguments Value Note Author(s) See Also Examples
View source: R/crossValidate.R
Crossvalidate a model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | crossValidate(model, ..., verbosity = 0)
## S3 method for class 'EMLassoGLoMo'
crossValidate(model,
ds=model$result[[1]]$ds, out=model$result[[1]]$out,
wts=rep(1, nrow(ds)),
imputeDs2FitDsProperties=model$imputeDs2FitDsProperties,
imputations=10, ..., type.measure="auc",
keepResultPerLambda=FALSE, nobs=1, unpenalized=FALSE,
verbosity=0)
repeatedlyPredictOut(glomo, ds, out, varsets, reps = 10,
nfolds = 10,
imputeDs2FitDsProperties = normalImputationConversion(),
returnGroups = FALSE, returnCoefs = FALSE, ...,
reusabledata, noScaling = TRUE, verbosity = 0)
repeatedPredictedProbAUC(reppredprob, out, verbosity = 0,
groups, onlyresult = TRUE, glmnetlike = TRUE)
cv.MI.logreg(glomo, ds, out, useVarNames, reps,
imputeDs2FitDsProperties = normalImputationConversion(),
lambda, useAsGlmnetFit, ..., verbosity = 0)
|
model |
model fit |
... |
for flexibility in 'derived' implementation
(passed on to |
verbosity |
The higher this value, the more levels of progress and debug information is displayed (note: in R for Windows, turn off buffered output) |
ds |
dataset with predictors |
out |
vector (binary factor) of outcomes |
wts |
vector of weights (defaults to equal weights for all rows) |
imputeDs2FitDsProperties |
see
|
imputations |
Number of multiple imputations on the complete dataset (defaults to 10) |
type.measure |
see |
keepResultPerLambda |
if |
nobs |
how many observations are simulated for each row with missing data |
unpenalized |
if |
glomo |
GLoMo model to predict from |
varsets |
list of character vectors holding the variables (names) to be checked |
reps |
number of predictions |
nfolds |
number of folds for crossvalidation |
returnGroups |
if |
returnCoefs |
if |
reusabledata |
optional premade result of
|
noScaling |
if |
reppredprob |
one of the matrices as return by
|
groups |
vector/matrix of fold membership assignment. If nor present, 10 random groups are created |
onlyresult |
if |
glmnetlike |
if |
useVarNames |
names of columns to include in the model (character vector) |
lambda |
value to use as lambda in the return value (note: ignored for the rest) |
useAsGlmnetFit |
object that can be used for the
|
object that has as class: "cv." pasted before the class
of model
. Normally, model
will will be the
return value of EMLasso
, so this result is
mainly the same as a cv.glmnet
. The
added/altered items are:
glmnet.fit |
is now the
|
resultPerLambda |
matrix
with one column per imputation. The top rows are the
estimates for the criterion per lambda, below that are
their SD estimates. Not present if
|
List of the same length as varsets
(unless it was
length 1, then the first object is simply returned). Each
item is a matrix with one row for each row in ds
and one column per reps
, and holds the predicted
probability in a crossvalidation.
named vector of length 2, holding the "AUC" and the "AUCSD"
object of classes "cv.MI.logreg", "cv.glmnet" and
"cv.lognet". Has exactly the items of a
cv.glmnet
object
aids to generalize crossvalidation
Nick Sabbe nick.sabbe@ugent.be
1 2 3 4 5 6 7 | y<-rbinom(nrow(iris), 1, 0.5)
iris.cpy<-randomNA(iris, n=0.1)
iris.emlognet<-EMLasso(ds=numdfr(iris.cpy), out=y,
lambdas=c(0.03,0.002,0.0003), nrOfSamplesPerMDRow=7, verbosity=2,
convergenceChecker=convergenceCheckCreator(minIt=5, maxIt=10))
sfStop()
iris.cv.emlognet<-crossValidate(iris.emlognet, verbosity=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.