cv {gcl} | R Documentation |
A function to do n-fold crossvalidation of a classifier function on a data set.
cv(df, mb, eval, fold = 2, seed = NULL, q.only = T, cv.verbose = F, ...)
df |
Data set (frame) |
mb |
Model builder, must return a function that takes
df as input and returns a matrix where entry (i,j) is the
classifiers belief of case i's memebership in class j |
eval |
Evaluation function, takes as input classifier generated
by mb above and data frame df |
fold |
How many folds. |
seed |
Set random seed to this (for reproducibility) |
q.only |
Return evaluation results only. |
cv.verbose |
If TRUE, output info. |
... |
Passed on. |
If q.only
is TRUE
then the function returns a vector of
evaluation results. Otherwise it returns a list.
cf |
The classifiers generated for each fold. |
q |
The evaluation results of each classifier on df |
Staal A. Vinterbo staal@dsg.harvard.edu
## Not run: cv(df, gcl, acc.eval) ## End(Not run)