# how to set the target for large data of multiple subjects in neural network?

1 view (last 30 days)
hana razak on 2 Nov 2017
Answered: Greg Heath on 9 Nov 2017
Hi,
I have 90 subjects with 1100 data each. Out of 90 subjects, 40 of them are positive and 50 of them are negative.
I managed to arrange them into 1100x90 from positive subjects,p to negative subjects,n respectively (first 40 column = p and last 50 column = n).
How to set the target vector for each subject (1100x1), where each p, t = 01 and each n, t = 10. In another way, I want to arrange them like this;
(:,1) -> t = 01
.
.
(:,40) -> t = 01
(:,41) -> t = 10
.
.
(:,90) -> t = 10
Hana

#### 1 Comment

hana razak on 9 Nov 2017
Hi,
I finally found the way to set the target by referring to this page;
I'm using MATLAB R2015a. To recall, I have the input data, data (1100x90) and target, t (2x90).
Here is how I'm setting the input and target for neural network;
data = horzcat( data{:} ) ; % data 1100x90 double
% target setting
t = zeros (2, 90);
t (1, 1:40) = ones (1, 40);
t (2, 41:90) = ones (1, 50); % t 2x90 double
% neural network setting
[ I N ] = [1100 90]
[ O N ] = [2 90]
net = patternnet(10);
[net,tr] = train(net,data,t);
Here I got an error,
Too many output arguments.
Error in test_nn (line 24)
[ I N ] = [1100 90]

Greg Heath on 9 Nov 2017