How to get validation test and training errors of a neural network?
    조회 수: 12 (최근 30일)
  
       이전 댓글 표시
    
I have created and trained a neural network using the following code .I want to know how to get the training testing and validation errors/mis-classifications the way we get using the matlab GUI.
trainFcn = 'trainscg';  % Scaled conjugate gradient backpropagation.
   % Create a Pattern Recognition Network
   hiddenLayerSize = 25;
   net = patternnet(hiddenLayerSize);
% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = trainper/100;
net.divideParam.valRatio = valper/100;
net.divideParam.testRatio = testper/100; 
% Train the Network
[net,tr] = train(net,x,t);
댓글 수: 0
채택된 답변
  Greg Heath
      
      
 2016년 8월 5일
        BOTH documentation commands
 help patternnet
and
 doc patternnet
have the following sample code for CLASSIFICATION & PATTERN-RECOGNITION:
    [x,t] = iris_dataset;
     net  = patternnet(10);
     net  = train(net,x,t);
     view(net)
     y = net(x);
     perf = perform(net,t,y);
     classes = vec2ind(y);
However, the following are missing
 1. Dimensions of x and t 
 2. Plots of x, t, and t vs x
 3. Minimum possible number of hidden nodes
 4. Initial state of the RNG (Needed for duplication)
 5. Training record, tr
 6. Plots of e = y-t vs x
 7. Misclassified cases
 8. trn/val/tst Error rates
For details see my NEWSGROUP posts
 SIZES OF MATLAB CLASSIFICATION EXAMPLE DATA SETS
http://www.mathworks.com/matlabcentral/newsreader/...
       view_thread/339984
 and
 BEYOND THE HELP/DOC DOCUMENTATION : PATTERNNET for 
 NN Classification and PatternRecognition
 http://www.mathworks.com/matlabcentral/newsreader/...
     view_thread/344832
Hope this helps.
Thank you for formally accepting my answer
Greg
댓글 수: 2
  Anton Tichenko
 2019년 4월 19일
				Hi Greg,
Noticed in a few answers here you are referring to "THE HELP/DOC DOCUMENTATION : PATTERNNET for NN Classification and PatternRecognition" and "SIZES OF MATLAB CLASSIFICATION EXAMPLE DATA SETS" posts
I can't find them anywhere, have they been removed? Any chance you could share again?
Thanks!
  Greg Heath
      
      
 2019년 4월 20일
				help and doc are to be used in the MATLAB command line. For example
>> help patternnet
 patternnet Pattern recognition neural network.
  ...
Hope this helps
Greg
추가 답변 (1개)
  Greg Heath
      
      
 2016년 7월 31일
         clear all, clc
  [ x, t ] = simplefit_dataset;
  net      = fitnet;
  rng('default')      % For reproducibility
  [ net tr y e ]   =  train( net, x, t );
  %  y = net(x); e = t - y;
   tr = tr % No semicolon:  LOOK AT ALL OF THE GOODIES!!!
 msetrn = tr.best_perf
 mseval = tr.best_vperf
 msetst = tr.best_tperf
Hope this helps
Thank you for formally accepting my answer
Greg
댓글 수: 5
  Mohamed Nedal
 2019년 11월 30일
				
      편집: Mohamed Nedal
 2019년 12월 14일
  
			Dear @Greg, 
Could you please elaporate on the difference between msetrn, mseval, and msetst? 
If I want to assess the overall performance of the NN and want to find the MSE for the NN as a whole, Which one should I use? 
  Mohamed Nedal
 2019년 11월 30일
				If I wrote this: 
rmse = sqrt(mean(e)); 
Does this give me the RMSE of the whole NN? 
참고 항목
카테고리
				Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!