Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update method stored in "call" for recombineSL and recombineCVSL #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion R/recombine.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ recombineSL <- function(object, Y, method = "method.NNloglik", verbose = FALSE)
stop("The supplied 'object' is not of class, SuperLearner.")
}

newMethod <- method
if (is.character(method)) {
if (exists(method, mode = 'list')) {
method <- get(method, mode = 'list')
Expand All @@ -35,6 +36,7 @@ recombineSL <- function(object, Y, method = "method.NNloglik", verbose = FALSE)

# get relevant objects from the SuperLearner fit object
call <- object$call
call[["method"]] <- newMethod
obsWeights <- object$obsWeights
control <- object$control
cvControl <- object$cvControl
Expand Down Expand Up @@ -129,6 +131,8 @@ recombineCVSL <- function(object, method = "method.NNloglik", verbose = FALSE, s
if (!inherits(object, "CV.SuperLearner")) {
stop("The supplied 'object' is not of class, CV.SuperLearner.")
}

newMethod <- method
if (is.character(method)) {
if (exists(method, mode = 'list')) {
method <- get(method, mode = 'list')
Expand All @@ -151,6 +155,7 @@ recombineCVSL <- function(object, method = "method.NNloglik", verbose = FALSE, s

# get relevant objects from the CV.SuperLearner object
call <- object$call
call[["method"]] <- newMethod
library <- object$SL.library
libraryNames <- object$libraryNames
folds <- object$folds
Expand Down Expand Up @@ -222,4 +227,4 @@ recombineCVSL <- function(object, method = "method.NNloglik", verbose = FALSE, s
Y = Y)
class(out) <- "CV.SuperLearner"
return(out)
}
}