Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
My data set have 60 images(11features each). there are 60 for train. 15 for validation. 30 for testing. my problem is, after writing this code am getting 100% accuracy which is absurd. plz help me in this matter as am not sure if my code is corre
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
load('trmat.mat'); %60 x 11 load('test.mat'); %1 x 60 x=transpose(trmat); t=test; inputs = x targets = t % Create a Pattern Recognition Network hiddenLayerSize = 10; net = patternnet(hiddenLayerSize); % Set up Division of Data for Training, Validation, Testing net.divideParam.trainRatio = 30/100; net.divideParam.valRatio = 13/100; net.divideParam.testRatio = 57/100;
% Train the Network [net,tr] = train(net,inputs,targets); % Test the Network outputs = net(inputs); errors = gsubtract(targets,outputs) performance = perform(net,targets,outputs) % View the Network view(net) % Plots % Uncomment these lines to enable various plots. figure, plotperform(tr) figure, plottrainstate(tr) figure, plotconfusion(targets,outputs) [c,cm] = confusion(targets,outputs) fprintf('Percentage Correct Classification : %f%%\n', 100*(1-c)); fprintf('Percentage Incorrect Classification : %f%%\n', 100*c); figure, ploterrhist(errors) trainTargets = targets .* tr.trainMask{1}; valTargets = targets .* tr.valMask{1}; testTargets = targets .* tr.testMask{1}; trainPerformance = perform(net,trainTargets,outputs) valPerformance = perform(net,valTargets,outputs) testPerformance = perform(net,testTargets,outputs)
1 Kommentar
Greg Heath
am 9 Feb. 2017
Bearbeitet: Greg Heath
am 9 Feb. 2017
1. Please use the {} operator to format your code.
2. State
a. number of classes (2?)
b. class sizes (30 & 30 ?)
c. target coding ( 1s and 0s ?)
3. The data division 30/13/57 doesn't make sense. What do you have
against the defaults?
4. Why didn't you print out the trn/val/tst error rates for each class?
5. When asking for help please
a. use the data in the help and doc patternnet documentation
b. use additional data from the MATLAB NN data base
help nndata
doc nndata
Greg
Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!