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

1 visualización (últimos 30 días)
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 comentario
hana razak
hana razak el 9 de Nov. de 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]
Please help me!!!

Iniciar sesión para comentar.

Respuesta aceptada

Greg Heath
Greg Heath el 9 de Nov. de 2017
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

Más respuestas (0)

Categorías

Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by