Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Training set and target set and output in Matlab neural network

Asked by Roy Deep on 14 Sep 2013
Latest activity Commented on by Greg Heath on 5 Nov 2013

let us say i have a data set

 patients      arrt1       attr2              attr3             disease 
   1            present     not present     heavily present         yes
   2           not present   present        heavily present         yes
   3.           present      present        heavily present         yes
   4           not present   present        present                  no 

So here disease attribute is the decision attribute.I am willing to detect such kind of disease for lets say 1000 patients. So my first question is what actually should the training set(dot mat format) contain and also what will be the target set(dot mat format). What will be the out put format.

please reply as early as possible.

0 Comments

Roy Deep

Products

No products are associated with this question.

3 Answers

Answer by Greg Heath on 19 Sep 2013
Accepted answer

Since not-present, present and heavily-present are interpreted as having an increasing order, you can represent them as ordered integers. examples [-1 0 1 ], [0 1 2 ] or [ 1 2 3]. The obvious choice for disease is [ 0 1 ].

Hope this helps.

Thank you for formally accepting my answer

Greg

P.S. See the comp.ai.neural-nets FAQ

0 Comments

Greg Heath
Answer by Roy Deep on 3 Nov 2013
Edited by Roy Deep on 3 Nov 2013

1 Comment

Roy Deep on 3 Nov 2013

will the "target" excel file order be 4X1 and "input" excel file 4X3. please also mention, whether for input data excel file 4X3 is the correct format ? and for the target excel data 4X1 is the correct format.Because I am using nntool, with back propagation neural network, I got error mentioning "input" and "target" data not matching. So, therefore I changed it to 3X4 for input data and 1X4 for target data, then it is working. But please reply to me, I am confused fully.I actually have to use Bck NN for large data set of 2000(rows)X20(atr) for input and as it is binary classification, so decision attribute i.e target data set is 2000X1. help me asp.

Roy Deep
Answer by Greg Heath on 3 Nov 2013
 patients   arrt1          attr2             attr3         disease    
    1      present        not present    heavily present      yes   
    2      not present    present        heavily present      yes   
    3      present        present        heavily present      yes   
    4      not present    present        present              no 
    1         1              0                  2              1   
    2         0              1                  2              1   
    3         1              1                  2              1   
    4         0              1                  1              0 

Your training data set should cover all I/O possibilities

Are there 3^3 = 27 input possibilities or 3*2^2 = 12 ?

Can the same input have different outputs? i.e., can two people have the same input attributes but one is diseased and the other is not?

For the above 4 patients, the MATLAB format is

 x = [ 1 0 1 0 ; 0 1 1 1 ; 2 2 2 1]
 x =   [  1     0     1     0
          0     1     1     1
          2     2     2     1 ]
 t =  [  1      1     1     0 ]

I'm not familiar with excel. However, whatever convention you use there, it should convert to the form I have illustrated ( or one that is equivalent).

2 Comments

Roy Deep on 4 Nov 2013

Thank you for the answer, I think your answer is absolutely correct. Sir, after applying NNTOOL I got the above Training,Validation, Test and Overall graph for the value "R". First of all what will be the interpretaion of these graph. And,if you see the graph, the data values have gone far away fron the FIT line(which creates 45 degree). Can you tell how to scale them so that the data points should stay near by the "FIT line". For that scale what is the change in the matlab script I need to do.I want to bring those data points which are far away the the "Fit" line

Greg Heath on 5 Nov 2013

You are mixing Apples and Oranges. This is a classification or pattern recognition problem which is handled by PATTERNNET instead of FITNET or FEEDFORWARDNET which are typically used for regression and curvefitting. Instead of the regression or curvefitting plots that you have obtained, you want the classification confusion matrix and ROC curves that are PATTERNNET defaults.

My last post was a lengthy one regarding classification

http://www.mathworks.com/matlabcentral/answers/104158-how-to-change-the-outputs-of-the-neural-network-that-the-error-function-receives

Some of the info shouldl be useful to you.

Greg Heath

Contact us