cv.ani {animation} | R Documentation |
Simply speaking, the process of cross-validation is just to split the whole data set into several parts and select one part as the test set and the rest parts as the training set. This function uses rectangles to illustrate these `parts' and mark the test set & the training set with different colors.
cv.ani(x = runif(150), k = 10, control = ani.control(interval = 2, nmax = 50), ...)
x |
a numerical vector which stands for the sample points. |
k |
an integer: how many parts should we split the data into? (comes from the k-fold cross-validation.) |
control |
control parameters for the animation; see ani.control |
... |
other arguments passed to ani.control |
The computation of sample sizes is base on kfcv
.
None (invisible `NULL
').
For the `leave-one-out' cross-validation, just specify k
as length(x)
, then the rectangles will `shrink' into single lines.
Yihui Xie
cv.ani() # leave-one-out CV cv.ani(x = runif(15), k = 15) ## Not run: # save the animation in HTML pages ani.start() cv.ani(saveANI = TRUE) ani.stop() ## End(Not run)