dear jack,

do you have an equal number of samples for all classes? the default metric
is a weighted average that takes into account imbalance across samples. see:

https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/metrics/metrics.py#L583

cheers,

satra


On Sat, Oct 6, 2012 at 11:32 AM, Jack Alan <[email protected]> wrote:

> Hi everybody,
>
> I'm using Sklearn for text classification. After training and testing,
> Sklearn has the ability to calculate interesting metrics, i.e. precision
> (P), recall (R) and f1-measure (F1).
>
> My question is:
> Suppose having 9 different classes and for each class we can have all P, R
> and F1. I saw that, sklearn calculate in the bottom of the result's table
> what it is called Average. I wounder this average how is calculated since I
> tried to devide the sum over the total number of classes and I got
> different average?
>
> I gave you a real example below:
>
>   Classes:
> Class1 P
> 0.62 R
> 0.69
> F
> 0.65  Class2 0.83 0.76 0.79  Class3 0.47 0.4 0.43  Class4 0.72 0.66 0.69
> Class5 0.88 0.68 0.77  Class6 0.77 0.91 0.83  Class7 0.82 0.72 0.77
> Class8 0.78 0.78 0.78  Class9 0.88 0.7 0.78   ---------------------        
> Sklearn
> - AVG 0.77 0.76 0.76 what I got AVG:               0.75
>  0.70               0.72
>
> Can anyone pinpoint me to the right answer? feeling struggled.
>
> Jack
>
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
>
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to