# doc-cache created by Octave 10.1.0
# name: cache
# type: cell
# rows: 3
# columns: 16
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
Contents


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2154
 BIOSIG/T400 contains classifiers.  


 TRAIN_SC      train classifier
 TEST_SC       test  classifier
 CLASSIFY	to classify samples into categories
 XVAL		cross-validation procedure
 UNTRAIN_SC	decremental training of classifier (depre
 FC0   generates classifier from "asychronous" data
 FINDCLASSIFIER generates BCI classifier [1-3]

 obsolete: 
 FINDCLASSIFIER1 generate classifier for a BCI [1,2]
 FINDCLASSIFIER2 2nd generation classifier for BCI [2,3]

  helper function

 PERM	permutations of indices in trials 
 TRAIN_LDA_SPARSE sparse LDA classifier

 Several core functions (like train_sc, test_sc, xval) have been included in the NaN-toolbox
 and will primarily be maintained there. For more details see: 
   http://pub.ist.ac.at/~schloegl/matlab/NaN 

 REFERENCES: 
 [1] Schloegl A, Neuper C, Pfurtscheller G
 	Estimating the mutual information of an EEG-based Brain-Computer-Interface
  	Biomedizinische Technik 47(1-2): 3-8, 2002.
 [2] Schloegl A, Keinrath C, Scherer R, Pfurtscheller G,
	Information transfer of an EEG-based Bran-computer interface.
	Proceedings of the 1st International IEEE EMBS Conference on Neural Engineering, Capri, Italy, Mar 20-22, 2003 
 [3] Schloegl A, Lee FY, Bischof H, Pfurtscheller G
	Characterization of Four-Class Motor Imagery EEG Data for the BCI-Competition 2005.
	Journal of neural engineering 2 (2005) 4, S. L14-L22
 [4] Schloegl A, Kronegg J, Huggins JE, Mason SG;
	Evaluation criteria in BCI research.
	(Eds.) G. Dornhege, J.R. Millan, T. Hinterberger, D.J. McFarland, K.-R.Mueller;
	Towards Brain-Computer Interfacing, MIT press, 2007, p. 327-342.
 [5] Schloegl A, Brunner C, Scherer R, Glatz A
       BioSig - an open source software library for BCI research.
       (Eds.) G. Dornhege, J.R. Millan, T. Hinterberger, D.J. McFarland, K.-R. Mueller;
       Towards Brain-Computer Interfacing, MIT Press, 2007, p.347-358.
 [6] Schloegl A., Brunner C.
	BioSig: A Free and Open Source Software Library for BCI Research,
	Computer, vol. 41, no. 10, pp. 44-50, October, 2008.

	$Id$
	Copyright (c) 1997-2005,2006,2008,2009 by Alois Schloegl
    	This is part of the BIOSIG-toolbox http://biosig.sf.net/



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
 BIOSIG/T400 contains classifiers.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
classify


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 792
 CLASSIFY classifies sample data into categories 
 defined by the training data and its group information 

  CLASS = classify(sample, training, group) 
  CLASS = classify(sample, training, group, TYPE) 
  [CLASS,ERR,POSTERIOR,LOGP,COEF] = CLASSIFY(...) 

  CLASS contains the assigned group. 
  ERR is the classification error on the training set weighted by the 
	prior propability of each group. 

  The same classifier as in TRAIN_SC are supported. 

 ATTENTION: no cross-validation is applied, therefore the 
    classification error is too optimistic (overfitting). 
    Use XVAL instead to obtain cross-validated performance. 
 
 see also: TRAIN_SC, TEST_SC, XVAL

 References: 
 [1] R. Duda, P. Hart, and D. Stork, Pattern Classification, second ed. 
       John Wiley & Sons, 2001. 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 CLASSIFY classifies sample data into categories 
 defined by the training da...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
covm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
undocumented function: [CC, NN] = covm (X, Y, Mode, W)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
undocumented function: [CC, NN] = covm (X, Y, Mode, W)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
decovm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
undocumented function: [mu, sd, COV, xc, M, R2] = decovm (XCN, NN)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
undocumented function: [mu, sd, COV, xc, M, R2] = decovm (XCN, NN)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
fc0


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 636
 FC finds a classifier for asnychroneous data
 
 [CC,Q,TSD,MD]=fc0(D,TRIG,class_times [,SWITCH]);

 D 	data, each row is one time point
 TRIG	trigger time points
 class_times each row defines a segment used for Classification
 SWITCH 0 [default] minimizes result
	2 only have of the possible t1-t2 combinations are used

 CC 	contains LDA and MD classifiers
 Q  	is a list of classification quality for each time of 'class_times'
 TSD 	returns the LDA classification 
 MD	returns the MD  classification 


 [CC,Q,TSD,MD]=fc(AR,find(trig>0.5)-257,reshape(1:14*128,16,14*8)');

 see also: COVM.M, QCMAHAL, MDBC, LDBC, 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 FC finds a classifier for asnychroneous data
 
 [CC,Q,TSD,MD]=fc0(D,TRIG,c...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
findclassifier


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2202
 FINDCLASSIFIER
   identifies and validates a classifier of a BCI systems [1-3]. 
   Several evaluation criteria are obtained [4]. Several Cross-validation 
   procedures are supported. 

 By default, a Trial-based Leave-One-Out-Method is used for Crossvalidation    
	MODE.Segments = class_times; 
	MODE.WIN   = t_ref; 
       [CC,Q,TSD] = findclassifier(D,TRIG,Class,MODE,t_ref,TYPE);
 Also this will work but its use is discouraged (it might become obsolete). 
       [CC,Q,TSD] = findclassifier(D,TRIG,Class,class_times,t_ref,TYPE);
 An K-fold cross-validation can be applied in this way: 
       ng = floor([0:length(Class)-1]'/length(Class)*K);
       [CC,Q,TSD] = findclassifier(D,TRIG,[Class,ng],...);

 D 	data, each row is one time point
 TRIG	trigger time points
 Class class information
 class_times	classification times, combinations of times must be in one row 
 t_ref	reference time for Class 0 (optional)
 TYPE  determines the type of classifier (see HELP TEST_SC for complete list)
       bthe default method is 'LD3'

 CC 	contains the classifier and the validation results
 Q  	is a list of classification quality for each time segment (as defined by 'class_times')
 TSD 	returns the discrimination 

 Example: 
  [CC,Q,TSD]=findclassifier(d,find(trig>0.5)-257,~mod(1:80,2),reshape(1:14*128,16,14*8)');

 see also: TRAIN_SC, TEST_SC, BCI4EVAL

 Reference(s): 
 [1] Schlögl A, Neuper C, Pfurtscheller G
 	Estimating the mutual information of an EEG-based Brain-Computer-Interface
  	Biomedizinische Technik 47(1-2): 3-8, 2002.
 [2] Schlögl A, Keinrath C, Scherer R, Pfurtscheller G,
	Information transfer of an EEG-based Bran-computer interface.
	Proceedings of the 1st International IEEE EMBS Conference on Neural Engineering, Capri, Italy, Mar 20-22, 2003 
 [3] Schlögl A, Lee FY, Bischof H, Pfurtscheller G
	Characterization of Four-Class Motor Imagery EEG Data for the BCI-Competition 2005.
	Journal of neural engineering 2 (2005) 4, S. L14-L22
 [4] Schlögl A, Kronegg J, Huggins JE, Mason SG;
	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, p327-342, 2007



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 FINDCLASSIFIER
   identifies and validates a classifier of a BCI systems [1-...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
findclassifier1


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 997
 FINDCLASSIFIER1
 
 [CC,Q,TSD,MD]=findclassifier1(D,TRIG,Class,class_times,t_ref);

 D 	data, each row is one time point
 TRIG	trigger time points
 Class class information
 class_times	classification times, combinations of times must be in one row 
 t_ref	reference time for Class 0 (optional)

 CC 	contains LDA and MD classifiers
 Q  	is a list of classification quality for each time of 'class_times'
 TSD 	returns the LDA classification 
 MD	returns the MD  classification 

 [CC,Q,TSD,MD]=findclassifier(AR,find(trig>0.5)-257,~mod(1:80,2),reshape(1:14*128,16,14*8)');


 Reference(s): 
 [1] Schlögl A., Neuper C. Pfurtscheller G.
 	Estimating the mutual information of an EEG-based Brain-Computer-Interface
  	Biomedizinische Technik 47(1-2): 3-8, 2002.
 [2] A. Schlögl, C. Keinrath, R. Scherer, G. Pfurtscheller,
	Information transfer of an EEG-based Bran-computer interface.
	Proceedings of the 1st International IEEE EMBS Conference on Neural Engineering, Capri, Italy, Mar 20-22, 2003 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 FINDCLASSIFIER1
 
 [CC,Q,TSD,MD]=findclassifier1(D,TRIG,Class,class_times,t_...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
findclassifier2


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1109
 FINDCLASSIFIER2
       is very similar to FINDCLASSIFIER1 but uses a different 
       criterion for selecting the time segment.
 [CC,Q,TSD,MD]=findclassifier2(D,TRIG,Class,class_times,t_ref);

 D 	data, each row is one time point
 TRIG	trigger time points
 Class class information
 class_times	classification times, combinations of times must be in one row 
 t_ref	reference time for Class 0 (optional)

 CC 	contains LDA and MD classifiers
 Q  	is a list of classification quality for each time of 'class_times'
 TSD 	returns the LDA classification 
 MD	returns the MD  classification 

 [CC,Q,TSD,MD]=findclassifier2(AR,find(trig>0.5)-257,~mod(1:80,2),reshape(1:14*128,16,14*8)');


 Reference(s): 
 [1] Schlögl A., Neuper C. Pfurtscheller G.
 	Estimating the mutual information of an EEG-based Brain-Computer-Interface
  	Biomedizinische Technik 47(1-2): 3-8, 2002.
 [2] A. Schlögl, C. Keinrath, R. Scherer, G. Pfurtscheller,
	Information transfer of an EEG-based Bran-computer interface.
	Proceedings of the 1st International IEEE EMBS Conference on Neural Engineering, Capri, Italy, Mar 20-22, 2003 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 FINDCLASSIFIER2
       is very similar to FINDCLASSIFIER1 but uses a differe...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
getclassifier


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 675
 GETCLASSIFIER yields the classifier from labeled data
   CC = getclassifier(d,c)
   CC = getclassifier(d1,d2)

 d     DATA
 c     CLASSLABEL 
 d1    DATA of class 1 
 d2    DATA of class 0
 Mode	'LDA' and 'MDA' implemented. 

 number of rows in d and c must fit, and C must be a column vector, 
 OR number of columns in d1 and d2 must fit. 
 The functions COVM.M and SUMSKIPNAN.M from the NaN-toolbox are 
 required [1] for Mode 'LDA' and 'MDA'.
 
 OUTPUT:
   CC 	classifier
 
 see also: LDBC, LLBC, MDBC, NaN/COVM

 Reference(s):
 [1] A. Schloegl, Missing values and NaN-toolbox for Matlab, 2000-2003.
 http://www.dpmi.tu-graz.ac.at/~schloegl/matlab/NaN/



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 GETCLASSIFIER yields the classifier from labeled data
   CC = getclassifier...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
perm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
undocumented function: perm = perm (x1, x2)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
undocumented function: perm = perm (x1, x2)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
sumskipnan


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
undocumented function: [o, count, SSQ] = sumskipnan (x, DIM, W)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
undocumented function: [o, count, SSQ] = sumskipnan (x, DIM, W)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
test_sc


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1441
 TEST_SC: apply statistical and SVM classifier to test data 

  R = test_sc(CC,D,TYPE [,target_Classlabel]) 
       R.output     	output: "signed" distance for each class. 
		This represents the distances between sample D and the separating hyperplane
		The "signed distance" is possitive if it matches the target class, and 
		and negative if it lays on the opposite side of the separating hyperplane. 
       R.classlabel 	class for output data
  The target class is optional. If it is provided, the following values are returned. 
       R.kappa 	Cohen's kappa coefficient
       R.ACC   	Classification accuracy 
       R.H     	Confusion matrix 

 The classifier CC is typically obtained by TRAIN_SC. If a statistical 
 classifier is used, TYPE can be used to modify the classifier. 
    TYPE = 'MDA'    mahalanobis distance based classifier
    TYPE = 'MD2'    mahalanobis distance based classifier
    TYPE = 'MD3'    mahalanobis distance based classifier
    TYPE = 'GRB'    Gaussian radial basis function 
    TYPE = 'QDA'    quadratic discriminant analysis
    TYPE = 'LD2'    linear discriminant analysis
    TYPE = 'LD3', 'LDA', 'FDA, 'FLDA'   (Fisher's) linear discriminant analysis
    TYPE = 'LD4'    linear discriminant analysis
    TYPE = 'GDBC'   general distance based classifier
 
 see also: TRAIN_SC

 References: 
 [1] R. Duda, P. Hart, and D. Stork, Pattern Classification, second ed. 
       John Wiley & Sons, 2001.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
 TEST_SC: apply statistical and SVM classifier to test data 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
train_lda_sparse


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1689
 Linear Discriminant Analysis for the Small Sample Size Problem as described in
 Algorithm 1 of J. Duintjer Tebbens, P. Schlesinger: 'Improving
 Implementation of Linear Discriminant Analysis for the High Dimension/Small Sample Size
 Problem', Computational Statistics and Data Analysis, vol. 52, no. 1, pp. 423-437, 2007.  
 Input:
               X                 ......       (sparse) training data matrix
               G                 ......       group coding matrix of the training data
               test              ......       (sparse) test data matrix
               Gtest             ......       group coding matrix of the test data
               par               ......       if par = 0 then classification exploits sparsity too
               tol               ......       tolerance to distinguish zero eigenvalues
 Output:
               err               ......       Wrong classification rate (in %)
               trafo             ......       LDA transformation vectors

 Reference(s): 
 J. Duintjer Tebbens, P. Schlesinger: 'Improving
 Implementation of Linear Discriminant Analysis for the High Dimension/Small Sample Size
 Problem', Computational Statistics and Data Analysis, vol. 52, no. 1, 
 pp. 423-437, 2007.

 Copyright (C) by J. Duintjer Tebbens, Institute of Computer Science of the Academy of Sciences of the Czech Republic,
 Pod Vodarenskou vezi 2, 182 07 Praha 8 Liben, 18.July.2006. 
 This work was supported by the Program Information Society under project
 1ET400300415.


 Modified for the use with Matlab6.5 by A. Schloegl, 22.Aug.2006

	$Id$
       This function is part of the NaN-toolbox
       http://pub.ist.ac.at/~schloegl/matlab/NaN/



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 Linear Discriminant Analysis for the Small Sample Size Problem as described ...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
train_sc


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7653
 Train a (statistical) classifier
 
  CC = train_sc(D,classlabel)
  CC = train_sc(D,classlabel,MODE)
  CC = train_sc(D,classlabel,MODE, W)
	weighting D(k,:) with weight W(k) (not all classifiers supported weighting)

 CC contains the model parameters of a classifier which can be applied 
   to test data using test_sc. 
   R = test_sc(CC,D,...) 

   D		training samples (each row is a sample, each column is a feature)	
   classlabel	labels of each sample, must have the same number of rows as D. 
 		Two different encodings are supported: 
		{-1,1}-encoding (multiple classes with separate columns for each class) or
		1..M encoding. 
 		So [1;2;3;1;4] is equivalent to 
			[+1,-1,-1,-1;
			[-1,+1,-1,-1;
			[-1,-1,+1,-1;
			[+1,-1,-1,-1]
			[-1,-1,-1,+1]
		Note, samples with classlabel=0 are ignored. 

  The following classifier types are supported MODE.TYPE
    'MDA'      mahalanobis distance based classifier [1]
    'MD2'      mahalanobis distance based classifier [1]
    'MD3'      mahalanobis distance based classifier [1]
    'GRB'      Gaussian radial basis function     [1]
    'QDA'      quadratic discriminant analysis    [1]
    'LD2'      linear discriminant analysis (see LDBC2) [1]
		MODE.hyperparameter.gamma: regularization parameter [default 0] 
    'LD3', 'FDA', 'LDA', 'FLDA'
               linear discriminant analysis (see LDBC3) [1]
		MODE.hyperparameter.gamma: regularization parameter [default 0] 
    'LD4'      linear discriminant analysis (see LDBC4) [1]
		MODE.hyperparameter.gamma: regularization parameter [default 0] 
    'LD5'      another LDA (motivated by CSP)
		MODE.hyperparameter.gamma: regularization parameter [default 0] 
    'RDA'      regularized discriminant analysis [7]
		MODE.hyperparameter.gamma: regularization parameter 
		MODE.hyperparameter.lambda =
		gamma = 0, lambda = 0 : MDA
		gamma = 0, lambda = 1 : LDA [default]
		Hint: hyperparameter are used only in test_sc.m, testing different 
		the hyperparameters do not need repetitive calls to train_sc, 
		it is sufficient to modify CC.hyperparameter before calling test_sc. 	
    'GDBC'     general distance based classifier  [1]
    ''         statistical classifier, requires Mode argument in TEST_SC	
    '###/DELETION'  if the data contains missing values (encoded as NaNs), 
		a row-wise or column-wise deletion (depending on which method 
		removes less data values) is applied;  
    '###/GSVD'	GSVD and statistical classifier [2,3], 
    '###/sparse'  sparse  [5] 
		'###' must be 'LDA' or any other classifier 
    'PLS'	(linear) partial least squares regression 
    'REG'      regression analysis;
    'WienerHopf'	Wiener-Hopf equation  
    'NBC'	Naive Bayesian Classifier [6]     
    'aNBC'	Augmented Naive Bayesian Classifier [6]
    'NBPW'	Naive Bayesian Parzen Window [9]     

    'PLA'	Perceptron Learning Algorithm [11]
		MODE.hyperparameter.alpha = alpha [default: 1]
		 w = w + alpha * e'*x
    'LMS', 'AdaLine'  Least mean squares, adaptive line element, Widrow-Hoff, delta rule 
		MODE.hyperparameter.alpha = alpha [default: 1]
    'Winnow2'  Winnow2 algorithm [12]

    'PSVM'	Proximal SVM [8] 
		MODE.hyperparameter.nu  (default: 1.0)
    'LPM'      Linear Programming Machine
                 uses and requires train_LPM of the iLog CPLEX optimizer 
		MODE.hyperparameter.c_value = 
    'CSP'	CommonSpatialPattern is very experimental and just a hack
		uses a smoothing window of 50 samples.
    'SVM','SVM1r'  support vector machines, one-vs-rest
		MODE.hyperparameter.c_value = 
    'SVM11'    support vector machines, one-vs-one + voting
		MODE.hyperparameter.c_value = 
    'RBF'      Support Vector Machines with RBF Kernel
		MODE.hyperparameter.c_value = 
		MODE.hyperparameter.gamma = 
    'SVM:LIB'    libSVM [default SVM algorithm)
    'SVM:bioinfo' uses and requires svmtrain from the bioinfo toolbox        
    'SVM:OSU'   uses and requires mexSVMTrain from the OSU-SVM toolbox 
    'SVM:LOO'   uses and requires svcm_train from the LOO-SVM toolbox 
    'SVM:Gunn'  uses and requires svc-functios from the Gunn-SVM toolbox 
    'SVM:KM'    uses and requires svmclass-function from the KM-SVM toolbox 
    'SVM:LINz'  LibLinear [10] (requires train.mex from LibLinear somewhere in the path)
            z=0 (default) LibLinear with -- L2-regularized logistic regression
            z=1 LibLinear with -- L2-loss support vector machines (dual)
            z=2 LibLinear with -- L2-loss support vector machines (primal)
            z=3 LibLinear with -- L1-loss support vector machines (dual)
    'SVM:LIN4'  LibLinear with -- multi-class support vector machines by Crammer and Singer
    'DT'	decision tree - not implemented yet.

 {'REG','MDA','MD2','QDA','QDA2','LD2','LD3','LD4','LD5','LD6','NBC','aNBC','WienerHopf','LDA/GSVD','MDA/GSVD', 'LDA/sparse','MDA/sparse', 'PLA', 'LMS','LDA/DELETION','MDA/DELETION','NBC/DELETION','RDA/DELETION','REG/DELETION','RDA','GDBC','SVM','RBF','PSVM','SVM11','SVM:LIN4','SVM:LIN0','SVM:LIN1','SVM:LIN2','SVM:LIN3','WINNOW', 'DT'};

 CC contains the model parameters of a classifier. Some time ago,     
 CC was a statistical classifier containing the mean 
 and the covariance of the data of each class (encoded in the 
  so-called "extended covariance matrices". Nowadays, also other 
 classifiers are supported. 

 see also: TEST_SC, COVM, ROW_COL_DELETION

 References: 
 [1] R. Duda, P. Hart, and D. Stork, Pattern Classification, second ed. 
       John Wiley & Sons, 2001. 
 [2] Peg Howland and Haesun Park,
       Generalizing Discriminant Analysis Using the Generalized Singular Value Decomposition
       IEEE Transactions on Pattern Analysis and Machine Intelligence, 26(8), 2004.
       dx.doi.org/10.1109/TPAMI.2004.46
 [3] http://www-static.cc.gatech.edu/~kihwan23/face_recog_gsvd.htm
 [4] Jieping Ye, Ravi Janardan, Cheong Hee Park, Haesun Park
       A new optimization criterion for generalized discriminant analysis on undersampled problems.
       The Third IEEE International Conference on Data Mining, Melbourne, Florida, USA
       November 19 - 22, 2003
 [5] J.D. Tebbens and P. Schlesinger (2006), 
       Improving Implementation of Linear Discriminant Analysis for the Small Sample Size Problem
	Computational Statistics & Data Analysis, vol 52(1): 423-437, 2007
       http://www.cs.cas.cz/mweb/download/publi/JdtSchl2006.pdf
 [6] H. Zhang, The optimality of Naive Bayes, 
	 http://www.cs.unb.ca/profs/hzhang/publications/FLAIRS04ZhangH.pdf
 [7] J.H. Friedman. Regularized discriminant analysis. 
	Journal of the American Statistical Association, 84:165–175, 1989.
 [8] G. Fung and O.L. Mangasarian, Proximal Support Vector Machine Classifiers, KDD 2001.
        Eds. F. Provost and R. Srikant, Proc. KDD-2001: Knowledge Discovery and Data Mining, August 26-29, 2001, San Francisco, CA.
 	p. 77-86.
 [9] Kai Keng Ang, Zhang Yang Chin, Haihong Zhang, Cuntai Guan.
	Filter Bank Common Spatial Pattern (FBCSP) in Brain-Computer Interface.
	IEEE International Joint Conference on Neural Networks, 2008. IJCNN 2008. (IEEE World Congress on Computational Intelligence). 
	1-8 June 2008 Page(s):2390 - 2397
 [10] R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin. 
       LIBLINEAR: A Library for Large Linear Classification, Journal of Machine Learning Research 9(2008), 1871-1874. 
       Software available at http://www.csie.ntu.edu.tw/~cjlin/liblinear 
 [11] http://en.wikipedia.org/wiki/Perceptron#Learning_algorithm
 [12] Littlestone, N. (1988) 
       "Learning Quickly When Irrelevant Attributes Abound: A New Linear-threshold Algorithm" 
       Machine Learning 285-318(2)
 	http://en.wikipedia.org/wiki/Winnow_(algorithm)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 Train a (statistical) classifier
 
  CC = train_sc(D,classlabel)
  CC = trai...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
untrain_sc


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 448
 UnTrain - decrementaal learning (untraining) of classifier 
 
  CC = untrain_sc(CC,classlabel,x)
       
 CC is a statistical classifier, it contains basically the mean 
 and the covariance of the data of each class. This information 
 is incoded in the so-called "extended covariance matrices".  

 CC can be used for various statistical classifiers included
  LDA, MDA, QDA, GRB, etc. 

 see also: TEST_SC, COVM, LDBC2, LDBC3, LDBC4, MDBC, GDBC



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 UnTrain - decrementaal learning (untraining) of classifier 
 
  CC = untrain...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
xval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2981
 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)
 
  example: 
      load_fisheriris;    %builtin iris dataset      
      C = species;
      K = 5; NG = [1:length(C)]'*K/length(C);
      [R,CC] = xval(meas,{C,[],NG},'NBC');            

 Input:
    D:	data features (one feature per column, one sample per row)
    classlabel	labels of each sample, must have the same number of rows as D. 
 		Two different encodings are supported: 
		{-1,1}-encoding (multiple classes with separate columns for each class) or
		1..M encoding. 
 		So [1;2;3;1;4] is equivalent to 
			[+1,-1,-1,-1;
			[-1,+1,-1,-1;
			[-1,-1,+1,-1;
			[+1,-1,-1,-1]
			[-1,-1,-1,+1]
		Note, samples with classlabel=0 are ignored. 

    CLASSIFIER can be any classifier supported by train_sc (default='LDA')
       {'REG','MDA','MD2','QDA','QDA2','LD2','LD3','LD4','LD5','LD6','NBC','aNBC','WienerHopf', 'RDA','GDBC',
	 'SVM','RBF','PSVM','SVM11','SVM:LIN4','SVM:LIN0','SVM:LIN1','SVM:LIN2','SVM:LIN3','WINNOW'}
       these can be modified by ###/GSVD, ###/sparse and ###/DELETION. 
	   /DELETION removes in case of NaN's either the rows or the columns (which removes less data values) with any NaN
	   /sparse and /GSVD preprocess the data an reduce it to some lower-dimensional space. 
       Hyperparameters (like alpha for PLA, gamma/lambda for RDA, c_value for SVM, etc) can be defined as 
 	CLASSIFIER.hyperparameter.alpha, etc. and 
 	CLASSIFIER.TYPE = 'PLA' (as listed above). 
       See train_sc for details.
    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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
 XVAL is used for crossvalidation 





