Why does the Neural Network Pattern Recognition Tool GUI not list my workspace variable for target data in Neural Network Toolbox 7.0.3 (R2012a)?

조회 수: 13 (최근 30일)
I have two workspace variables, a and b as follows
a=rand(10,200);
b=rand(1,200);
When I launch the NPRTOOL, I can see the workspace variables in "Inputs" but not for "Targets". I tried to import the variable as a MAT file but it still does not show up as a variable to select.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2012년 7월 17일
The target variable for Neural Network Pattern Recognition Tool in Neural Network Toolbox 7.0.3 (R2012a) needs to be a matrix of ones or zeros indicating which class the corresponding input belongs to. For example, the variable could be as follows:
>> target_var=[ 1 0 0 0;
0 0 1 0;
0 1 0 1];
where first column represents class 1; second column means class 3, and so on.
In case you need to convert your already defined class matrix (one-
dimensional) to a matrix of appropriate ones and zeros, you can do it as follows:
>> ind = [1 3 2 3] ;
>> vec = ind2vec(ind) ;
>> target_var = full(vec)
ans =
1 0 0 0
0 0 1 0
0 1 0 1
which you can then use as variable for your "Targets".
You can also have a look at the variables which were used in the Example Data Sets. Please click "Load Example Data Set". The Pattern Recognition Data Set Chooser window opens. Choose a data set, for example. "Breast Cancer", and click Import. You can then view these variables in the workspace.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Pattern Recognition and Classification에 대해 자세히 알아보기

제품


릴리스

R2012a

Community Treasure Hunt

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

Start Hunting!

Translated by