classification
Afficher commentaires plus anciens
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 commentaire
Walter Roberson
le 2 Jan 2012
Thank you for taking the time to format your code!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Linear Predictive Coding dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!