performance tester code

4 views
Skip to first unread message

Mina Naghshnejad

unread,
Jan 17, 2012, 11:54:05 AM1/17/12
to machine_learning_90sbu

Here is the code that I have written to test the overal performance and the performance for each class of cells:

 

 

function p = performance ( y,t) %y is assumed to be the target vector and t is the classifier outcome, y and t should be % of the same size

p=mean(y==t);

fprintf('overal performance : %d\n' ,p);

for i=1:6

temp=mean (ismember(find(t==i),find(y==i)));

fprintf('performance for class %d is %d\n',i,temp);

end

end

 

 

usage hint:

here is my own usage with the result:

>>X=rand(721,1)<0.7;

>>t=knnclassify(features(~X,1:33),features(X,1:33),features(X,34),8);

>>performance(features(~X,34),t)

overal performance is 72.6

performance for class 1 is 87.8      % homogeneous

performance for class 2 is 76.0       %centromere

performance for class 3 is 67.8        %nucleolar  

performance for class 4 is 79.4       % coarse speckled

performance for class 5 is 42.2        %fine speckled

performance for class 6 is 1.00         %cytoplasmatic


Ali Katanforoush

unread,
Jan 17, 2012, 3:21:35 PM1/17/12
to machine_lea...@googlegroups.com

Nice code. Thank you and two comments;
1) The second measure of performance that you coded is literately called
"sensitivity". So you can say e.g. "The sensitivity of the classifier on
homogeneous samples is %87.8" or "The classifier is less sensitive on
cytoplasmaic samples" and so on. It is also called "recall" in IR
terminology. For example, you can say "The classifier recalls %87.8 of
homogeneous samples". The first measure is simply called "accuracy".
2) Had you have a cell array of class labels? If not simply you can
create one by
classLabels={'homogeneous', 'centromere', 'nucleolar', 'coarse
speckled', 'fine speckled', 'cytoplasmic'}
and call classLabels(i) in your codes for the convenient.

http://en.wikipedia.org/wiki/Sensitivity_and_specificity

Mina Naghshnejad

unread,
Jan 17, 2012, 11:37:54 PM1/17/12
to Machine_Learning_90.sbu
Thanks,
it was very useful.
the sensetivity of cytoplasmic is 100, I just did not multiply it by
mistake.
Regards,
Mina Naghshnejad
> http://en.wikipedia.org/wiki/Sensitivity_and_specificity- Hide quoted text -
>
> - Show quoted text -

Mina Naghshnejad

unread,
Jan 17, 2012, 11:41:42 PM1/17/12
to Machine_Learning_90.sbu
I accidentally typed 1.00 for cytoplasmic (class 6) , the outcome is
fortunately 100.00. we owe it to radon transform features. without 20
radon transform feature,
I had about 42 for accuray and 75.0 for sensetivity to cytoplasmic
with the same random X.

On Jan 17, 7:54 pm, Mina Naghshnejad <mina.naghshne...@gmail.com>
wrote:

Ali Katanforoush

unread,
Jan 18, 2012, 3:11:26 AM1/18/12
to machine_lea...@googlegroups.com
Radon is always a promising feature in computer vision.

Mina Naghshnejad

unread,
Jan 18, 2012, 3:32:34 AM1/18/12
to Machine_Learning_90.sbu
but this one is radon of fft on rows of fft of columns of fft of
colums of fft of columns of image.!
> Radon is always a promising feature in computer vision.- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages