how to get best result of plot confusion figure
1 view (last 30 days)
Show older comments
how to get best of plot confusion figure when we train my neural network my neural network contain of input of 500*100 and target of 5*100 we want to classification the into 5 class
0 Comments
Accepted Answer
Greg Heath
on 6 Jul 2014
Quick answer: Also use the confusion function and test on one or more MATLAB nndataset examples
NOTE: I have removed some of the ending semicolons so that you can see the output in the command window
help/doc confusion % Sometimes doc is more informative than help
help/doc plotconfusion
help/doc nndatasets
Two good examples for this question are
help/doc simpleclass_dataset
help/doc iris_dataset % Notice the error: replace 1000 with 150
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
clear all, close all, clc
[ x, t ] = iris_dataset;
[ I N ] = size(x) % [ 4 150 ]
[ O N ] = size(t) % [ 3 150 ]
% Make sure that columns of t are columns of eye(3)
minmaxt = minmax(t)
% minmaxt = 0 1
% 0 1
% 0 1
innert = find(0 < t & t < 1) % Empty matrix: 0-by-1
H = 2 % No. of hidden nodes (default H=10 is overfitting)
net = patternnet(H);
rng(0)
[ net tr y e ] = train(net,x,t); % e = t-y
[c,cm,ind,per] = confusion(t,y)
plotconfusion(t,y);
% NOTE: You may want to type tr = tr to see what is in the training record
Hope this helps.
Thank you for formally accepting my answer
Greg
0 Comments
More Answers (0)
See Also
Categories
Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!