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

1 次查看(过去 30 天)
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
Please help me to arrange the data as desired. Thank you
Hana
  1 个评论
hana razak
hana razak 2017-11-9
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]
Please help me!!!

请先登录,再进行评论。

采纳的回答

Greg Heath
Greg Heath 2017-11-9
https://www.mathworks.com/matlabcentral/answers/366130-why-does-i-n-o-n-for-the-neural-network-doesn-t-work
Thank you for formally accepting my answer
Greg

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by