PRCROSSVAL Error/performance estimation by cross validation (rotation)
[ERR,CERR,NLAB_OUT] = PRCROSSVAL(A,CLASSF,NFOLD,1,TESTFUN)
DescriptionCross validation estimation of the error (defined by TESTFUN) of the untrained classifier CLASSF using the dataset A. The set is randomly permutated and divided in NFOLD (almost) equally sized parts, using a stratified procedure. The classifier is trained on NFOLD-1 parts and the remaining part is used for testing. This is rotated over all parts. ERR is the weighted class error avaraged over the class priors. CERR are the class error frequencies. The inputs A and/or CLASSF may be cell arrays of datasets and classifiers. In that case ERR is an array with on position ERR(i,j) the error of classifier j for dataset i. In this mode CERR and NLAB_OUT are returned in cell arrays. For NREP > 1 the mean error(s) over the repetitions is returned in ERR and the standard deviations in the observed errors in STDS. If NREP == 'DPS', crossvalidation is done by density preserving data splitting (DPS). In this case NFOLD should be a power of 2. In case CLASSF == [] an [NREPS,M] index array is returned pointing to a fold for all M objects. No training or testing is done. This is useful for handling training and testing outside PRCROSSVAL. Inside PRCROSSVAL warnings generated by PRWARNING are temporarily suppressed. Reference(s)1. R. Kohavi: A Study of Cross-Validation and Bootstrap for Accuracy Estimation and Model Selection. IJCAI 1995: 1137-1145. See alsodatasets, mappings, dps, cleval, testc,
|