cv.ani {animation}R Documentation

Demonstration for the process of cross-validation

Description

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.

Usage

cv.ani(x = runif(150), k = 10, control = ani.control(interval = 2, 
    nmax = 50), ...)

Arguments

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

Details

The computation of sample sizes is base on kfcv.

Value

None (invisible `NULL').

Note

For the `leave-one-out' cross-validation, just specify k as length(x), then the rectangles will `shrink' into single lines.

Author(s)

Yihui Xie

See Also

kfcv

Examples

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)

[Package animation version 0.2-0 Index]