Learn R Programming

gencve (version 0.3)

cgcv: Estimate Misclassification Rate Using d-fold Cross-Validation for Class Prediction

Description

This is a general purpose function to estimate the misclassification rate for a specified classifier.

Usage

cgcv(X, y, yh = yh_NN, MaxIter = 1000, d = ceiling(length(y)/10), NCores = 1, libs = character(0), seed = "default", ...)

Arguments

X
inputs
y
output factor
yh
function with arguments dfTrain and dfTest that produces the missclassification rate for test data
MaxIter
Number of iterations of the CV procedure
d
Number of observations for the hold-out sample
NCores
Default is 1 which does not use the parallel package. Otherwise, you can set to the number of cores available. If unsure, just experiment!
libs
Required libraries needed for the predictor.
seed
Default is to use R's default which is based on the current time. Otherwise set to an integer value. See Details.
...
Additional arguments that are passed to yh.

Value

Examples

Run this code
Xy <- rmix(200) #training data
X <- as.matrix.data.frame(Xy[,1:2])
y <- Xy[,3]
cgcv(X, y, MaxIter=50)

Run the code above in your browser using DataLab