How to display Confusion matrix of Testing ,Training and Validation without using nprtool
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Saira
el 18 de Jun. de 2012
Comentada: Supriya Pahwa
el 6 de Ag. de 2015
Hello Everyone ,
I want to display confusion matrix of Testing , Training and validation through code .
plotConfusion(Target, Output) only displays the overall confusion matrix .
i can only show the three matrices first time i train the network using newpr. How to display them again ?
0 comentarios
Respuesta aceptada
Greg Heath
el 19 de Jun. de 2012
net = patternnet(x,t,H); [net tr ] = train(net,x,t);
The training record in the structure tr contains the indices for the trn/val/tst subsets.
Therefore, they can be used to obtain separate performance results.
Hope this helps.
Greg
3 comentarios
Rina Blomberg
el 25 de Mzo. de 2015
% x = inputs, t = targets, y = outputs
% Train the Network
[net, tr] = train(net, x, t);
% Training Confusion Plot Variables
yTrn = net(x(:,tr.trainInd));
tTrn = t(:,tr.trainInd);
% Validation Confusion Plot Variables
yVal = net(x(:,tr.valInd));
tVal = t(:,tr.valInd);
% Test Confusion Plot Variables
yTst = net(x(:,tr.testInd));
tTst = t(:,tr.testInd);
% Overall Confusion Plot Variables
yAll = net(x);
tAll = t;
% Plot Confusion
plotconfusion(tTrn, yTrn, 'Training', tVal, yVal, 'Validation', tTst, yTst, 'Test', tAll, yAll, 'Overall')
Supriya Pahwa
el 6 de Ag. de 2015
yTst = net(x(:,tr.testInd)) when i use this command, i get an error. Subscript indices must either be real positive integers or logicals.
Más respuestas (0)
Ver también
Categorías
Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!