MATLAB: How to compute the goodness of fit or the mean square error after training the neural network

ann

Hi all, I am using nntool for patter recognition problem.After training the network, the outputs that are created are errors,info,network model.How to compute the goodness of fit or mean square error of the network after training it ? Thank you

Best Answer

The best figure of merit for classification and pattern recognition is a weighted average of between-class misclassification rates. Sophisticated models use weights that depend on the product of class dependent a priori probabilities and between-class misclassification costs (See your favorite book on pattern recognition, e.g., Duda et al).
c-class network targets are chosen to be columns of the c-dimensional unit matrix. The target matrix of dimension [ c N ] is obtained from the row vector of true class indices in the interval [1,c] and vice-versa:
target = ind2vec(trueclassindices);
trueclassindices = vec2ind(target);
Corresponding real-valued network outputs are interpreted as class posterior probabilities, conditional on the input.
Indices for assigned classifications are determined from the maximum posterior estimate via
assignedclassindices = vec2ind(output);
The corresponding N-dimensional 0/1 error row vector is obtained from
err = (assignedclassindices~=trueclassindices);
from which the number of errors and corresponding error rates for each class can be obtained.
Search the NEWSGROUP and ANSWERS for examples. For example
greg patternnet vec2ind
Hope this helps.
Thank you for formally accepting my answer
Greg