how to store target into array bpnn?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
if true
% code
endhi, i'm working on project of classification images. i have 4 classes. the dataset of the training in the last column is the class label where 4 class. 1-4.
how to write a code to store the target into array. i want to make if the target is 4, it will store 1000. my code below did not work.
loadinput = dlmread('Train.csv');<
x = loadinput;
tempt = loadinput;
x(:,2501)=[];
noofInputSet = length(x(:,1));
disp(noofInputSet);
noofInputNode = length(x(1,:));
noofHiddenNode = noofInputNode / 2;
noofInputBiasNode = 1;
noofHiddenBiasNode = 1;
noofOutputNode = 4;
for r=1:noofInputNode
tempt(:,1)=[];
%store target into array t
for sT=1:noofInputSet
if tempt(sT)==1,
t(sT) =1000;
elseif tempt(sT)==2,
t(sT) = 0100;
elseif tempt(sT)==3,
t(sT)=0010;
elseif tempt (sT)==4,
t(sT)=0001;
end
-can somebody help me fix this
0 commentaires
Réponses (1)
Greg Heath
le 15 Juin 2016
TARGET VECTORS SHOULD BE COLUMNS OF THE UNIT MATRIX eye(4)
classindices = [ 1 2 3 4 3 2 1]
target = full(ind2vec(classindices))
classindices = vec2ind(target)
Hope this helps.
Thank you for formally accepting my answer
Greg
2 commentaires
Greg Heath
le 16 Juin 2016
You probably won't get any help until you correctly format your code.
Greg
Voir également
Catégories
En savoir plus sur Recognition, Object Detection, and Semantic Segmentation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!