kNN_LOOCV: Select k with Leave-one-out CV

Description Usage Arguments Details Value Examples

Description

Use leave-one-out CV to select k

Usage

1
kNN_LOOCV(X, y, kmax=ceiling(length(y)*0.5), plot=FALSE)

Arguments

X

design matrix

y

response vector

kmax

maximum value of k to consider

plot

show plot of mis-classification rate

Details

Leave one out CV is used for odd values of k from 1 to kmax.

Value

plot produced

Examples

1
2
Xy <- rmix(300) #training data
kNN_LOOCV(Xy[,1:2], Xy[,3], plot=FALSE)

gencve documentation built on May 29, 2017, 7:12 p.m.