Description Usage Arguments Value Examples
View source: R/mainFunctions.R
This function is a helper wrapper function for the cvAUC
function
included in the cvAUC
package by Erin LeDell. The function allows
the user to use the data splitting options available in the SuperLearner
package and provides a specific structure for different learners to be used
to generate predictions. The biggest addition with this function is that influence
functions are returned, which can be used to develop hypothesis tests comparing
the CV-AUC between two different learners. The function diff_cvAUC
performs these tests.
1 2 3 4 5 6 7 8 9 10 11 12 |
Y |
A |
X |
A |
learner |
A |
confidence |
A |
seed |
A |
id |
A |
cvControl |
A |
returnFits |
A |
parallel |
A |
... |
Not currently used |
An object of class wrap_cvAUC
with the following entries:
cvAUC |
The estimated cross-validated AUC. |
se |
The standard error for the estimated CV-AUC. |
ci |
A |
confidence |
The level of confidence for the interval. |
ic |
The estimated influence function evaluated on the observations. |
folds |
The row indices for each validation sample. |
fitLibrary |
The fit objects from |
learner |
The learner that was used to generate predictions. |
p |
The one-sided p-value testing the null hypothesis that CV-AUC = 0.5 against the alternative that CV-AUC > 0.5. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | n <- 1000
X <- data.frame(x1=rnorm(n),x2=rnorm(n))
Y <- rbinom(n,1,plogis(X$x1 + X$x2))
myglm1 <- function(Y,X,newX){
fm <- glm(Y~.,data=X,family=binomial())
pred <- predict(fm,newdata=newX,type="response")
return(list(fit = fm, pred = pred))
}
myglm2 <- function(Y,X,newX){
fm <- glm(Y~x1,data=X,family=binomial())
pred <- predict(fm,newdata=newX,type="response")
return(list(fit = fm, pred = pred))
}
out1 <- wrap_cvAUC(Y = Y, X=X, learner = "myglm1")
out2 <- wrap_cvAUC(Y = Y, X=X, learner = "myglm2")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.