File: resampleWrapper.R

package info (click to toggle)
r-cran-caret 7.0-1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,036 kB
  • sloc: ansic: 210; sh: 10; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 495 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#' @rdname caret-internal
#' @export
resampleWrapper <- function(x, ind) 
{
   out <- rep(NA, dim(x$data)[1])
   trainData <- x$data
   x$data <- x$data[ind,]
   tmpModelFit <- do.call(createModel, x)
   outBagData <- trainData[-ind, ]        
   outBagData$.outcome <- NULL
   
   out[-ind] <- if(is.factor(x$data$.outcome))
   {
      as.character(predictionFunction(x$method, tmpModelFit, outBagData))
   } else {
      predictionFunction(x$method, tmpModelFit, outBagData)
   }   
   out
}