Skip to content

Commit

Permalink
Fixed a bug for failure testing
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo committed Jun 26, 2017
1 parent c14bff9 commit c1aa8fa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/caret/R/recipes.R
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,9 @@ preproc_dots <- function(...) {
model_failed <- function(x) {
if(inherits(x, "try-error"))
return(TRUE)
if(inherits(x$fit, "try-error"))
return(TRUE)
if(any(names(x) == "fit"))
if(inherits(x$fit, "try-error"))
return(TRUE)
if(any(names(x) == "recipe"))
if(inherits(x$recipe, "try-error"))
return(TRUE)
Expand Down Expand Up @@ -736,7 +737,7 @@ rec_model <- function(rec, dat, method, tuneValue, obsLevels,
modelFit$obsLevels <- obsLevels
modelFit$param <- list(...)
}

list(fit = modelFit, recipe = trained_rec)
}

Expand Down

0 comments on commit c1aa8fa

Please sign in to comment.