How many classification categories, c ?
What is the dimensionality, I, of the input feature column vectors?
How many input column vectors for each class? N1=?,N2=?,...,Nc=?
Total number of input vectors N = sum(i=1:c){Ni}
Target vectors are N c-dimensional (0,1) unit column vectors from eye(c)
MATLAB classification function documentation:
help patternnet
doc patternnet
MATLAB classification examples:
help nndatasets
doc nndatasets
Choose Iris flower classification example:
[ x, t] = iris_dataset;
[ I N ] = size( x)
[ c N ] = size( t )
truclassindices = vec2ind( t );
Test with the default No. of hidden nodes
H = 10
net = patternnet( H );
rng('default')
[ net tr y e ] = train( net, x, t );
classindices = vec2ind( t );
err = classindices ~= truclassindices;
Nerr = sum(err)
PctErr = 100*Nerr/N
tr = tr
% Individual train/val/test errors for each class can be readily obtained by extracting the individual train/val/test indices from the training record tr.
Hope this helps.
Thank you for formally accepting my answer
Greg
Best Answer