Nothing
#' Perform simple CV, and return the MSE estimate
#'
#' @inheritParams R2oosse
#' @return The MSE estimate
simpleCV = function(y, x, fitFun, predFun, nFolds){
folds = sample(rep(unFolds <- seq_len(nFolds), length.out = length(y)))
mean(unlist(lapply(unFolds, function(uf){
idTrain = folds!=uf
predTest = predFun(fitFun(y[idTrain], x[idTrain,,drop = FALSE]),
x[!idTrain,,drop = FALSE])
(predTest-y[!idTrain])^2
})))
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.