% Returns the correctness rate of a classification result as
% CorrectPredictions/NumberOfPredictions.
%
% Both column matrices must have exactly binary coded classes. Use
% class_compete() before this.
%
% Correctness rate is not all. You should be wary also of the rate of
% false positives and false negatives for each class.

function rate = classif_rate(cOut, trueOutputs);
  if size(cOut,1)==1
    correct = sum((cOut-trueOutputs)==0);
    rate = correct / size(trueOutputs,2);
    return
  end

  correct = sum(max(cOut-trueOutputs) == 0);
  rate = correct / size(trueOutputs,2);
