The Perl Advent Calendar needs more articles for 2022. Submit your idea today!

NAME

RePrec - compute recall precision curves

SYNOPSIS

  require RePrec::<Subclass>;

DESCRIPTION

RePrec is an abstract class for computing recall precision curves. Subclasses implement different recall-precision curve interpretation measures. Theoretical background is given in detail by the Information Retrieval Lecture Notes by Norbert Fuhr (chapter 3, Evaluation). Web address: http://ls6-www.cs.uni-dortmund.de/ir/teaching/.

METHODS

    $rp = RePrec::<Subclass>->new($distribution)

    constructor. Takes as argument a distribution. $distribution is a reference to an array containing a two element array reference for each rank (top most rank first). The first element within the references contains the number of relevant documents while the second one contains the number of non-relevant documents.

    $visual = $rp->visual

    returns a textual representation of the searchresult.

    ($graph, $average) = $rp->calculate([$points])

    calculates precision values for $points. $points may be an integer (specifying for how many recall points precision is to be computed), an reference to a list of recall points, the string smart (implying the recall points 0.25, 0.50, and 0.75), the string trec (implying recall points 0, 0.1, 0.2, ..., 1), or the string rank (implying one recall point computed after each rank). If argument $points is omitted precision will be computed for ten recall points (i. e., 0.1, 0.2, ..., 1).

    As a result you get a list of (recall, precision) pairs (array of array references with two elements each) and the averaged precision (over all recall points computed).

    @precision = $rp->precision(@recall)

    calculate precision for recall points in @recall. Returned is an array of (recall, precision) pairs (array of array references with two elements each). This method is abstract within this class, you need to choose the proper implementation from the subclasses (or overwrite it in your own RePrec subclass).

    @precision = $rp->precision_rank

    calculate precision after each rank. Returned is an array of (recall, precision) pairs (array of array references with two elements each).

    $rp->gnuplot([$gnuplot])

    plot curve with gnuplot(1). $gnuplot is a hash reference where parameters for gnuplot can be set.

    $rp->write_rpdata($file, [$average]);

    Write the recall-precision data to file(s). Writes data for average precision if $average is true.

BUGS

Yes. Please let me know!

SEE ALSO

Different recall-precision measures:

RePrec::Ceiling(3), RePrec::EP(3), RePrec::EP_ND(3), RePrec::PRR(3), RePrec::Raw(3), RePrec::Salton(3)

Parsing of searchresults and relevance judgements

RePrec::Collection(3), RePrec::Collection::FERMI(3), RePrec::Collection::Paris(3), RePrec::Searchresult(3), RePrec::Searchresult::HySpirit(3)

Miscellaneous tools

RePrec::Average(3), RePrec::Tools(3), reprec(1)

Other

gnuplot(1), perl(1)

AUTHOR

Norbert Gövert <goevert@ls6.cs.uni-dortmund.de>

3 POD Errors

The following errors were encountered while parsing the POD:

Around line 40:

You can't have =items (as at line 61) unless the first thing after the =over is an =item

Around line 114:

=cut found outside a pod block. Skipping to next block.

Around line 232:

=cut found outside a pod block. Skipping to next block.