Learn R Programming

animation (version 0.2-0)

cv.ani: 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

Value

  • None (invisible `NULL').

Details

The computation of sample sizes is base on kfcv.

See Also

kfcv

Examples

Run this code
cv.ani()

# leave-one-out CV 
cv.ani(x = runif(15), k = 15) 

# save the animation in HTML pages
ani.start()
cv.ani(saveANI = TRUE)
ani.stop()

Run the code above in your browser using DataLab