필터 지우기
필터 지우기

How to set target variable for multiple features in Pattern recognition app of neural network classifier?

조회 수: 1 (최근 30일)
I am using pattern recognition app of neural netwrok in matlab.I have 3005 features for six objects. For classification problem, i am putting inputs=[x1(3005 features);x2(3005features),........]. For target variable i am putting that as target=[1 0 0 0 0 ......(upto 3005); 0 1 0 0 0 0 0 (upto3005); 0 0 1 0 0 0 (upto 3005). ]. But i am getting weried confusion matrix. I guess my target set was not correct. Could you please let me know either my target set is okay or not? I appreciate your help. I look forward to hearing you soon.
I am attaching my code below:
inputs=[TransposeUniqueFeature(1,:);TransposeUniqueFeature(2,:);TransposeUniqueFeature(3,:);TransposeUniqueFeature(4,:);TransposeUniqueFeature(5,:);TransposeUniqueFeature(6,:)];
targets=[TransposeUniqueFeature(7,:);TransposeUniqueFeature(8,:);TransposeUniqueFeature(9,:);TransposeUniqueFeature(10,:);TransposeUniqueFeature(11,:);TransposeUniqueFeature(12,:)];
% Create a Pattern Recognition Network
hiddenLayerSize = 80;
net = patternnet(hiddenLayerSize);
% Set up Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 60/100;
net.divideParam.testRatio = 30/100;
net.divideParam.valRatio = 10/100;
% Train the Network
[net,tr] = train(net,inputs,targets);
% Test the Network
outputs = net(inputs);
errors = gsubtract(targets,outputs);
performance = perform(net,targets,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)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Pattern Recognition and Classification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by