Hi,
I am having trouble using the macro and micro averaged f1_score as shown
below

>>> gt = [0, 0, 1, 1, 0, 0, 1, 1, 0];
>>> gt
[0, 0, 1, 1, 0, 0, 1, 1, 0]
>>> pr = [0, 0, 1, 0, 0, 0, 1, 0, 0];
>>> from sklearn.metrics import f1_score
>>> f1_score(gt, pr, average='macro')
0.66666666666666663
>>> f1_score(gt, pr, average=None)
array([ 0.83333333,  0.66666667])
>>> f1_score(gt, pr, average='micro')
0.66666666666666663
>>>

The non-averaged version seems fine, but averaged versions are confusing.
Do you have any clues? I am using scikit-learn 0.14 with python 3.3

Best,
Yuan
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to