Precision and Recall metrics in nltk

439 views
Skip to first unread message

Rami Al-Rfou'

unread,
Feb 19, 2012, 3:36:40 PM2/19/12
to nltk-...@googlegroups.com
Hi,

I am trying to figure out how to use precision and recall methods in nltk. There is no examples in the module to explain usage.

While accuracy method accepts lists of gold and test lists to compute accuracy, precision and recall methods accept sets of values.


Regards.


Lars Buitinck

unread,
Feb 19, 2012, 4:05:24 PM2/19/12
to nltk-...@googlegroups.com
2012/2/19 Rami Al-Rfou' <rmy...@gmail.com>:

It seems like these functions can be used to compute precision and
recall for something like a search engine, where you get a set of
results for a query, but not for classifier evaluation. scikit-learn
has precision, recall and F1 for classification, if that's what you're
looking for. http://scikit-learn.org/stable/modules/classes.html#classification-metrics

Correa Denzil

unread,
Feb 20, 2012, 6:26:15 AM2/20/12
to nltk-...@googlegroups.com


--Regards,
Denzil




On Mon, Feb 20, 2012 at 2:35 AM, Lars Buitinck <lars...@gmail.com> wrote:
2012/2/19 Rami Al-Rfou' <rmy...@gmail.com>:
> I am trying to figure out how to use precision and recall methods in nltk.
> There is no examples in the module to explain usage.
>
> While accuracy method accepts lists of gold and test lists to compute
> accuracy, precision and recall methods accept sets of values.

It seems like these functions can be used to compute precision and
recall for something like a search engine, where you get a set of
results for a query, but not for classifier evaluation.

Interesting, is this true? I see a post by Jacob Perkins on StreamHacker (his blog) saying something different. It would be great if there's an official confirmation on this. 

 
scikit-learn
has precision, recall and F1 for classification, if that's what you're
looking for. http://scikit-learn.org/stable/modules/classes.html#classification-metrics

--
You received this message because you are subscribed to the Google Groups "nltk-users" group.
To post to this group, send email to nltk-...@googlegroups.com.
To unsubscribe from this group, send email to nltk-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nltk-users?hl=en.


Lars Buitinck

unread,
Feb 20, 2012, 9:56:24 AM2/20/12
to nltk-...@googlegroups.com
2012/2/20 Correa Denzil <mce...@gmail.com>:

> Interesting, is this true? I see a post by Jacob Perkins on
> StreamHacker (his blog) saying something different. It would be great if
> there's an official confirmation on this.

Never mind my previous comment. J. Perkins feeds sets of indices to
the precision and recall functions. The only difficulty is then that
the measures have to be computed per class and averaging is left to
the user. I hadn't thought of that possibility.

Reply all
Reply to author
Forward
0 new messages