cvDataGen
Generate m-fold cross validation (CV) data for performance evaluation
Contents
Syntax
- cvData=cvDataGen(DS)
- cvData=cvDataGen(DS, opt)
- cvData=cvDataGen(DS, opt, showPlot)
- [cvData, dispatchMat4index, dispatchMat4output]=cvDataGen(...)
Description
[cvData, count]=cvDataGen(DS, opt) generates cross-validation data for performance evaluation.
- DS: dataset to be partitioned
- opt: options, with the following fields
- foldNum: number of folds
- cvDataType: 'index' (index only, default) or 'full' (full data)
- randomized: 1 or 0, for using random permutation or not
- foldId: the fold ID for each sample, which overwrite foldNum
Example
DS=prData('nonlinearseparable'); opt=cvDataGen('defaultOpt'); opt.foldNum=2; opt.cvDataType='full'; cvData=cvDataGen(DS, opt); subplot(121); dsScatterPlot(cvData(1).TS); subplot(122); dsScatterPlot(cvData(1).VS);