What is the use of the target matrix and how do i create one?

Illustration
Clifford Moses - 2021-07-30T12:52:37+00:00
Question: What is the use of the target matrix and how do i create one?

We are developing a neural network for classification there are 72 signals and there are 100 samples of each signal. We have extracted 49 parameters from each signal. What should my target matrix contain  

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

The current neural network classification function is PATTERNNET (replacing the obsolete NEWPR). The syntax of the target matrix for N I-dimensional column inputs that are to be assigned into into 1 of c classes is N c-dimensional {0,1} unit vectors from the unit matrix eye(c).
 
 [ I N ] = size(input)
 [ c N ] = size(target)

The transformation between the true class index row vector and the corresponding target matrix is

target       = full(ind2vec(trueclassind)) 
trueclassind = ind2vec(target)

Therefore, if the classifier output is

 output = target+ randn(1,N)

the estimated classindex and error vectors are

 estclassind = vec2ind(output)
 error       = estclassind~=trueclassind
 Nerr        = sum(error)
 PctErr      = 100*Nerr/N

1. Test the above code with N = 9,

 classind = [ 9 7 5 3 1 8 6 4 2 ]

2. See the online documentation

 help patternnet
 doc patternnet

3. Search both the NEWSGROUP and ANSWERS for my examples

 greg patternnet


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!