how to get best test error/accuracy with neural networks pattern recognition ?
    3 ビュー (過去 30 日間)
  
       古いコメントを表示
    
This is Neural Network Pattern Recognition.I used a vec dataset 1*54149 and 1*54149 target and I'm trying to train my neural network to do binary classification (1 and 0).i want get best ? So please someone can help me ?. thank you in advance
clear all;   
clc;   
load vec; load target;     
inputs = double(vec);    
targets = double(target);      
% Create a Pattern Recognition Network    
hiddenLayerSize = 1;    
%net = patternnet(hiddenLayerSize);    
net = patternnet(hiddenLayerSize);    
% Choose Input and Output Pre/Post-Processing Functions    
% For a list of all processing functions type: help nnprocess     
net.inputs{1}.processFcns = {'removeconstantrows','mapstd'};     
net.outputs{2}.processFcns = {'removeconstantrows','mapstd'};     
% Setup Division of Data for Training, Validation, Testing     
% For a list of all data division functions type: help nndivide      
net.divideFcn = 'dividerand';     
net.divideMode = 'sample';  % Divide up every sample     
net.divideParam.trainRatio = 50/100;     
net.divideParam.valRatio = 25/100;      
net.divideParam.testRatio = 25/100;     
% For a list of all training functions type: help nntrain      
net.trainFcn = 'trainrp';        
% Choose a Performance Function      
% For a list of all performance functions type: help nnperformance      
net.performFcn = 'mse';         
% Choose Plot Functions      
% For a list of all plot functions type: help nnplot      
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...    
  'plotregression', 'plotfit'};       
% Train the Network      
[net,tr] = train(net,inputs,targets);      
% Test the Network      
outputs = net(inputs);       
errors = gsubtract(targets,outputs);       
performance = perform(net,targets,outputs);        
[tpr,fpr,thresholds] = roc(targets,outputs);        
% Recalculate Training, Validation and Test Performance      
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);         
% View the Network      
view(net)       
   %Plots      
  % Uncomment these lines to enable various plots.      
  figure, plotperform(tr)      
  figure, plottrainstate(tr)        
  figure, plotconfusion(targets,outputs)     
  figure, ploterrhist(errors)      
  figure, plotregression(targets,outputs)     
  figure, plotroc(targets,outputs)



0 件のコメント
採用された回答
  Greg Heath
      
      
 2014 年 3 月 26 日
        Obvious:
1. plot(x,t,'.') to estimate how much training data is really needed to adequately characterize the classes AND to identify and remove or modify outliers
2. Then the short answer is to increase the number of hidden nodes, H, AND for each value of H, loop over multiple (10?) designs with different random initial weights. For examples search using
 greg Hmax Ntrials   
 ( where Hmax << Hub = -1 + ceil( (Ntrn-1)/3) ~ round(Ntrn/3) )
ADDITIONAL COMMENTS:
3. TRAINSCG is preferred for classification unless the necessary minimum value of Ntrn is huge. Then TRAINRP is preferred.
4. It may be worthwhile (OR JUST INTERESTING) to
 a. Compare the default properties of both 
      net = trainscg  % No semicolon
      net = trainrp 
 b. See how large Ntrn can be before TRAINRP has to be used.
5. Delete or comment all statements that specify values that are already defaults (Different for SCG and RP)
6. If Ntrn is sufficiently large, Nval and Ntst will probably not add any new information.
Hope this helps.
Thank you for formally accepting my answer
Greg
2 件のコメント
  Greg Heath
      
      
 2014 年 3 月 28 日
				NEWSGROUP and ANSWERS designs:
I have posted jillions of double loop designs
for j = Hmin:dH:Hmax
...
   for I = 1:Ntrials
...
   end
end
Thee is no shortage of detail. Try the NEWSGROUP first.
その他の回答 (1 件)
  Vrushabh Bhangod
 2018 年 10 月 21 日
        SIR, I Want a Neural Network with Logsig as the activation function and validation 0, Training % 70%, testing % 30%, learning rate 0.1, momentum coefficient and I am unable to find the accuracy. Kindly answer the earliset
0 件のコメント
参考
カテゴリ
				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!