% No Big Difference using newpr or patternnet and epochs reduction % Asked by farzad on 21 Feb 2015 at 13:32 % Latest activity Edited by farzad about 9 hours ago % % I have used the following code , for my input and target file that I have % attached as well , am I correct that newpr is Obsolete from MATLAB % 2010 ? but when I replaced the newpr command with patternnet(10) % there were some changes in number of the epochs , but not in the total % results , I would like to ask your help to improve one of these codes to % give the best results to the input that I have attached
Since you have the current PATTERNNET, FORGEDABOUD DA obsolete NEWPR.
However, when designing NON-OBSOLETE multiple nets in a for loop, the weights have to be EXPLICITLY initialized before training using CONFIGURE or INIT.
% so I put the codes I have used here :
Hmmm, look familiar (;>) !
SNIP
%Then I changed from newpr to patternnet in the same code :
However, you did not initialize the weights at the top of the inner for loop.
% 2 - Then I also tried to use another code that I found from this post : % here but I was not able to catch all the corrections that were advised % by Proff. Heath , so I only used the original code. well there is a % difference in confusion , that in the first code , only one of the green % squares show a number like 189 / 100% , and only in one of the % classes : 2 , not all of the four classes , why is that ?
Not understandable.
% 3 - I also tried to use the sine(x) function by defining x vector and sin(x) , % is input and target , but the code did not accept due to having 4 classes.
Doesn't make sense: That is regression, NOT classification!
% 4 - And another question is , where in the first code , the curve fitting is % done ?
No curvefitting: it's classification, not regression!
% 5- how much can I rely on % net = init(net); % net = train(net,houseInputs,houseTargets); % and how many times repeat of it after running the code ?
I'd guess somewhere between 10 and 90 per cent, PROVIDED you have the correct range of hidden node values AND you design ~ 10 nets for each value of hidden nodes.
% As an update I used mapstd after getting the inputs , but then doubted I % should use mapminmax or mapstd ?.
The CURRENT nets automatically normalize and unnormalize using the default MAPMINMAX. However, I prefer to use ZSCORE (easier to use than MAPSTD) BEFORE design to modify and/or delete outliers. Then I am too lazy to override MAPMINMAX, so I keep it.
% As an update I used % z=sim(net,input); % % but it just created a vector of negative numbers between 1 and -1 , don't know % how to use it !?
Assuming your classification target matrix had {0,1} unit matrix columns, you have to unnormalize your output and then use vec2ind to obtain the output classes.
The CURRENT syntax replaces SIM with
z = net(input);
Hope this helps.
Thank you for formally accepting my answer
Greg
Best Answer