フィルターのクリア

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

1 回表示 (過去 30 日間)
hana razak
hana razak 2017 年 11 月 2 日
回答済み: Greg Heath 2017 年 11 月 9 日
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 Center および File ExchangeSequence 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