CV.SuperLearner_tidiers: Tidying method(s) for a CV.SuperLearner fit object

CV.SuperLearner_tidiersR Documentation

Tidying method(s) for a CV.SuperLearner fit object

Description

This method extends tidy to tidy the results from a CV.SuperLearner fit (screening, prediction, or both) into a summary.

Usage

## S3 method for class 'CV.SuperLearner'
tidy(x, ...)

Arguments

x

object of class CV.SuperLearner

...

Passed through to tidy.SuperLearner. Optional arguments include algorithm, includeAll, and stringsAsFactors. See tidy.SuperLearner for documentation.

Value

A data.frame without rownames. Column names included depend on the supplied value for the optional tidy.SuperLearner argument algorithm. See tidy.SuperLearner for more details on returned data.frame. Note that the resulting data.frame from tidy.CV.SuperLearner will contain one additional column, however: "fold," indicating the (outer) SuperLearner cross-validation fold number.

See Also

tidy.SuperLearner

Examples

# based on an example in the SuperLearner package
set.seed(1)
n <- 100
p <- 10
X <- matrix(rnorm(n*p), nrow = n, ncol = p)
X <- data.frame(X)
Y <- rbinom(n, 1, plogis(.2*X[, 1] + .1*X[, 2] - .2*X[, 3] + .1*X[, 3]*X[, 4] - .2*abs(X[, 4])))

library(SuperLearner)
cvsl = CV.SuperLearner(Y, X, family = binomial(),
                       SL.library = list(c("SL.mean", "screen.FSelector.oneR"),
                                         c("SL.mean", "screen.wgtd.ttest"),
                                         c("SL.glm", "screen.FSelector.oneR"),
                                         c("SL.glm", "screen.wgtd.ttest")),
                       cvControl = list(V = 2),
                       innerCvControl = list(list(V = 2)))

library(broom)
tidy(cvsl)
tidy(cvsl, algorithm = "screening")
tidy(cvsl, algorithm = "both")


saraemoore/SLScreenExtra documentation built on Nov. 4, 2023, 9:31 p.m.