필터 지우기
필터 지우기

training multilabel data with traingdm function of Neural network toolbox

조회 수: 3 (최근 30일)
pooja
pooja 2014년 3월 16일
댓글: pooja 2014년 3월 19일
Hello Guyz
i was wondering is there any way to train multilabel-data (i.e more than 1 class labels in output for single instance ) using traingdm (gradient decent with momentum)?
here, every col of p corresponds to one output value of t
p = [-1 -1 2 2;0 5 0 5];
t = [-1 -1 1 1];
net=newff(minmax(p),[3,1],{'tansig','purelin'},'traingdm')
but i need something like this
p = [-1 -1 2 2;0 5 0 5]; t = [-1 -1 1 1 ; 1 1 -1 1 ; 1 1 1 -1 ; -1 1 -1 1];
i.e each column (instance) of p corresponds to set of output values (in this case 4)
is this possible ?
Please Help ...Thank you so much !!

채택된 답변

Greg Heath
Greg Heath 2014년 3월 16일
For classification/pattern-recognition, newpr is favored over newff
For regression/curve-fitting, newfit is favored over newff
Both call newff but all three have different default plot selections
However, all three are doubly obsolete. So, if you have them, use the current functions patternnet or fitnet which call feedforwardnet.
When designing a classifier with c mutually exclusive classes, target should contain columns of the c-dimensional unit matrix eye(c). The row index of the single 1 is the corresponding class index in [1,c]. The relationships are
target = ind2vec(trueclass)
trueclass = vec2ind(target)
[ net tr output RegressErr] = train(...)% RegressErr = target-output
assignedclass = vec2ind(output)
ClassErr = (assignedclass ~= trueclass);
Nerr = sum(ClassErr)
PctErr = 100*Nerr/N
% For trn/val/tst breakdowns of the results, use tr.trainInd, etc
Hope this helps.
Thank you for formally accepting my answer
Greg
  댓글 수: 1
pooja
pooja 2014년 3월 17일
편집: pooja 2014년 3월 17일
Thank you for your giving your time and answer sir,
i am a beginner so i apologize for so many questions
after getting output , can we define our custom error measures ? like hamming loss ,ranking loss etc (specifically for multilabel classification)
and get performance result according to these measures?
i hope my question would be clear , thank you for considering!!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Greg Heath
Greg Heath 2014년 3월 18일
Whoops! I think I misled you. My answer assumed mutually exclusive classes.
For non-mutually exclusive classes the targets can not be unit column vectors with one nonzero component.
I have two recommendations :
1. A 4 output classifier with {0,1} targets so that outputs can be interpreted as input conditional probability estimates. However, you should try either the obsolete newpr or the current patternnet which are designed for classification problems. Accept all defaults so that you don't get confused with default normalizations, transfer functions, and renormalizations.
2. If many trials of the above by varying number of hidden nodes and initial weights (as in many of my examples ... search on greg Ntrials) don't work well enough, try 4 separate classifiers.
Again, sorry for the misdirection.
Greg

카테고리

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