error using classperf function
Show older comments
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 Comment
Greg Heath
on 7 Nov 2013
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
Accepted Answer
More Answers (0)
Categories
Find more on Workspace Variables and MAT Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!