how to get best result of plot confusion figure
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Greg Heath
2014-7-6
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!