CERROR

Computes classification error.



 Synopsis:
  error = cerror(ypred,ytrue)
  error = cerror(ypred,ytrue,label) 

 Description:
  error = cerror(ypred,ytrue) returns classification error, i.e.,
      error=  find(ypred~=ytrue)/length(ytrue).

  error = cerror(ypred,ytrue,label) considers only labels
    find(ytrue==label), i.e., if ypred, ytrue are from {1,2} then

   false_positives_rate = cerror(ypred,ytrue,2)
   false_negatives_rate = cerror(ypred,ytrue,1)

 Input:
  y1 [1 x n] Vector of integers (response of classifier).
  y2 [1 x n] Vector of integers (ground truth).
  label [int] Selected label.

 Output:
  error [real] Error. 

 Example:
  classifier  = [1,1,1,2]
  groundtruth = [2,1,2,1]
  error = cerror(classifier,groundtruth)
  false_pos = cerror(classifier,groundtruth,2)
  false_neg = cerror(classifier,groundtruth,1)

 See also
  ROC


Source: cerror.m

About: Statistical Pattern Recognition Toolbox
(C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac
Czech Technical University Prague
Faculty of Electrical Engineering
Center for Machine Perception

Modifications:
08-aug-2005, VF
09-jun-2004, VF
14-Jan-2003, VF