classification

조회 수: 11 (최근 30일)
gokul
gokul 2012년 1월 2일
편집: Greg Heath 2014년 11월 22일
I want to learn how to do classification using Neural Network in Matlab Having Elliptical Basis Function , Can any one help .... Code is attached
What I know is that first I need to create NN and then make Decision Making
Function ( Elliptical Basis Function )
tic
maxround = 5;
hiddenLayerSize = [3 5 7 10 13];
errors = zeros(maxround,1);
trainPerformance = zeros(maxround,1);
valPerformance = zeros(maxround,1);
testPerformance = zeros(maxround,1);
timedata = zeros(maxround,1);
NoofNeurons = zeros(maxround,1);
Accuracy = zeros(maxround,1);
TestFold = zeros(maxround,1);
NoOfClasses = zeros(maxround,1);
NoofInstances = zeros(maxround,1);
SizeofInputLayer = zeros(maxround,1);
for i=1: maxround
net = patternnet(hiddenLayerSize);
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
NoOfinputs = net.inputs
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};
NoOfOutPuts = net.outputs
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
net.trainFcn = 'trainlm'; % Levenberg-Marquardt
net.performFcn = 'mse'; % Mean squared error
[net,tr] = train(net,inputs,targets);
outputs = net(inputs);
errors = gsubtract(targets,outputs);
performance(i) = perform(net,targets,outputs);
trainTargets = targets .* tr.trainMask{1};
valTargets = targets .* tr.valMask{1};
testTargets = targets .* tr.testMask{1};
trainPerformance(i) = perform(net,trainTargets,outputs);
valPerformance(i) = perform(net,valTargets,outputs);
testPerformance(i) = perform(net,testTargets,outputs);
NoofNeurons(i) = hiddenLayerSize(1);
NameofDataSet = 'Heart';
TestFold(i) = i;
NoOfClasses(i) = size(targets,1); % Number of classed to be classified
NoofInstances(i) = size(targets,2); % Number of Instances
SizeofInputLayer(i) = size(inputs,2);
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 1월 2일
Thank you for taking the time to format your code!

댓글을 달려면 로그인하십시오.

채택된 답변

Greg Heath
Greg Heath 2012년 1월 4일
  댓글 수: 2
Greg Heath
Greg Heath 2012년 1월 8일
편집: Greg Heath 2014년 11월 22일
IGNORE THIS COMMENT OF 8 JAN 2012. IT IS BASED ON FAULTY LOGIC. FOR ANY OTHER VALUE OF THE LINEAR COMBINATION THAN ZERO, THE CONTOURS ARE ELLIPTIC. =========================================================================== WHOOPS! MY APOLOGIES!
I have just realized that , in general, NEWFF with RADBAS will not create EBFs. Consider a two-input net with w11*x1+w12*x2 + b1 the argument of RADBAS.
Obviously, exp(-(w11*x1+w12*x2+b1)^2) is equal to 1 along the line 0 =w11*x1+w12*x2+b1. Therefore the constant level contours are not ellipses.
Sorry for the bum steer.
Greg
Puneet Arora
Puneet Arora 2012년 1월 16일
Then what do you suggest .. I need to change the H and O , My I-H-O is structure : 1 (inputs)-H- 4 (Outputs) and H = [1 2 4 8 16 32 64]
net = newff(minmax(ptrn),[H O],{'radbas', 'purelin'});
I m doing classification iris dataset ...

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by