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