R/holdout.R

# Hold-out method
# @param df A data-frame
hold_out <- function(df) {
    i <- 0
    imax <- length(df[,1])
    function() {
        i <<- i + 1
        if(i > imax) return(NA)
        one <- df[i,]
        rest <- df[-i,]
        return(list(one=one,rest=rest))
    }
}

Try the pnn package in your browser

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

pnn documentation built on May 2, 2019, 9:30 a.m.