Description Usage Arguments Value See Also Examples
Crossvalidate a glmnet PIM
1 2 3 |
pimob |
Object of class |
method |
|
type.measure, nfolds, foldid, weights |
See |
include.extrainfo |
If |
verbosity |
The higher this value, the more levels of progress and debug information is displayed (note: in R for Windows, turn off buffered output) |
... |
Passed on to |
An object of class cv.pim, of class cv.glmnet, and depending on the type
of linkfunction (see cv.glmnet) some more classes.
It holds all the items of the original pimob and all necessary items for a
cv.glmnet object (so the relevant S3 methods like print and plot will
work for them.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | set.seed(1)
pen.N<-100
pen.noisep<-50
pen.noisemat<-matrix(rnorm(pen.N*pen.noisep), nrow=pen.noisep)
pendta<-data.frame(y=rnorm(pen.N), x=factor(sample(2, pen.N, replace=TRUE)), pen.noisemat)
pendta$y[pendta$x=="2"]<-pendta$y[pendta$x=="2"]+1
colnames(pendta)[(1:pen.noisep)+2]<-paste("X", 1:pen.noisep, "X", sep="")
pen.formula<-paste("y~", paste(c("F(x)", setdiff(colnames(pendta), c("x", "y"))), collapse="+"), sep="")
penpim<-pim(as.formula(pen.formula), data=pendta, link="identity", poset=noselfposet,
estimator=estimator.glmnet(), varianceestimator=NULL, keep.data=TRUE, verbosity=0,
interpretation="regular")
cv.penpim.naive<-crossvalidate.pim(penpim, method="naive")
cv.penpim<-crossvalidate.pim(penpim, method="fullsplit")
cv.penpim.ps<-crossvalidate.pim(penpim, method="semisplit")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.