error using classperf function
조회 수: 2 (최근 30일)
이전 댓글 표시
I am working on neural network ,I want ti find the classifier performance,but i get error
Indices = crossvalind('Kfold',class1 , 10);cp = classperf(class1);
for i=1:10
test = (Indices == i);
trainn = ~test;
net = newff(inputs(:,trainn),targets(:,trainn),20,{},'trainscg');
net = train(net,res1(trainn),class1(trainn));
a = sim(net,res1(test));
% b=sim(net,inputs(:,test));
classperf(cp,a,test)
end
i have input as 4x30
error msg is
When the class labels of the CP object are numeric, the output of the classifier must be all non-negative integers or NaN's.
kindly assist
댓글 수: 1
Greg Heath
2013년 11월 7일
It would help immensely if you tried your code on MATLAB data:
help nndatasets.
Have you thought about including a non-training validation design set to prevent overtraining an overfit net?
What version are you using?
>> help newff newff Create a feed-forward backpropagation network.
Obsoleted in R2010b NNET 7.0. Last used in R2010a NNET 6.0.4.
Why NEWFF instead of the classification/pattern-recognition function NEWPR? Remember,as of 2010
NEWFIT/NEWPR/NEWFF ==> FITNET/PATTERNNET/FEEDFORWARDNET
I'll try your code on
help simpleclass_dataset
Greg
채택된 답변
Greg Heath
2013년 11월 8일
편집: Greg Heath
2013년 11월 8일
Why the RBF tag ??
SORRY. I cannot run your code because I have neither CROSSVALIND nor CLASSPERF.
HOWEVER, I understand the error message:
Your targets should be unit vectors containing only one "1" with the rest zeros. Regardless of the normalization used for training, unnormalized output values will be continuous over an interval [ -eps1, 1+eps2]. To get valid class indices use VEC2IND(a).
Hope this helps.
Thank you for formally accepting my answer
Greg
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!