R/predictionFunction.R

Defines functions predictionFunction

Documented in predictionFunction

#' @rdname caret-internal
#' @importFrom stats predict
#' @export
predictionFunction <- function(method, modelFit, newdata, preProc = NULL, param = NULL)
{
  if(!is.null(newdata) && !is.null(preProc)) newdata <- predict(preProc, newdata)
  out <- method$predict(modelFit = modelFit, 
                        newdata = newdata, 
                        submodels = param)
  ## TODO convert to character with classification
  out 
}

Try the caret package in your browser

Any scripts or data that you put into this service are public.

caret documentation built on Aug. 9, 2022, 5:11 p.m.