Home > biosig > t400 > xval.m

xval

PURPOSE ^

XVAL is used for crossvalidation

SYNOPSIS ^

function [R,CC]=xval(D,classlabel,MODE,arg4)

DESCRIPTION ^

 XVAL is used for crossvalidation 

  [R,CC] = xval(D,classlabel)
  .. = xval(D,classlabel,CLASSIFIER)
  .. = xval(D,classlabel,CLASSIFIER,type)
  .. = xval(D,[classlabel,W],CLASSIFIER)
  .. = xval(D,[classlabel,W,NG],CLASSIFIER)

 Input:
    D:    data features (one feature per column, one sample per row)
    classlabel  classlabel (same number of rows)
    CLASSIFIER can be any classifier supported by train_sc (default='LDA')
    {'MDA','MD2','LD2','LD3','LD4','LD5','LD6','NBC','aNBC','WienerHopf','REG','LDA/GSVD','MDA/GSVD', 'LDA/sparse','MDA/sparse','RDA','GDBC','SVM','RBF'}
    W:    weights for each sample (row) in D. 
    default: [] (i.e. all weights are 1)
    number of elements in W must match the number of rows of D 
    NG: used to define the type of cross-valdiation
     Leave-One-Out-Method (LOOM): NG = [1:length(classlabel)]' (default)
     Leave-K-Out-Method: NG = ceil([1:length(classlabel)]'/K)
    K-fold XV:  NG = ceil([1:length(classlabel)]'*K/length(classlabel))
    group-wise XV (if samples are not indepentent) can be also defined here
    samples from the same group (dependent samples) get the same identifier
    samples from different groups get different classifiers
    TYPE:  defines the type of cross-validation procedure if NG is not specified 
    'LOOM'  leave-one-out-method
       k    k-fold crossvalidation

 OUTPUT: 
    R contains the resulting performance metric
    CC contains the classifier  

    plota(R) shows the confusion matrix of the results

 see also: TRAIN_SC, TEST_SC, CLASSIFY, PLOTA

 References:
 [1] R. Duda, P. Hart, and D. Stork, Pattern Classification, second ed.
       John Wiley & Sons, 2001.
 [2] A. Schlögl, J. Kronegg, J.E. Huggins, S. G. Mason;
       Evaluation criteria in BCI research.
       (Eds.) G. Dornhege, J.R. Millan, T. Hinterberger, D.J. McFarland, K.-R.Müller;
       Towards Brain-Computer Interfacing, MIT Press, 2007, p.327-342

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003