![]() |
![]()
| ![]() |
![]()
NAMEAI::Categorizer::Experiment - Coordinate experimental results SYNOPSISuse AI::Categorizer::Experiment; my $e = new AI::Categorizer::Experiment(categories => \%categories); my $l = AI::Categorizer::Learner->restore_state(...path...); while (my $d = ... get document ...) { my $h = $l->categorize($d); # A Hypothesis $e->add_hypothesis($h, [map $_->name, $d->categories]); } print "Micro F1: ", $e->micro_F1, "\n"; # Access a single statistic print $e->stats_table; # Show several stats in table form DESCRIPTIONThe "AI::Categorizer::Experiment" class helps you organize the results of categorization experiments. As you get lots of categorization results (Hypotheses) back from the Learner, you can feed these results to the Experiment class, along with the correct answers. When all results have been collected, you can get a report on accuracy, precision, recall, F1, and so on, with both macro-averaging and micro-averaging over categories. METHODSThe general execution flow when using this class is to create an Experiment object, add a bunch of Hypotheses to it, and then report on the results. Internally, "AI::Categorizer::Experiment" inherits from the "Statistics::Contingency". Please see the documentation of "Statistics::Contingency" for a description of its interface. All of its methods are available here, with the following additions:
AUTHORKen Williams <ken@mathforum.org> COPYRIGHTThis distribution is free software; you can redistribute it and/or modify it under the same terms as Perl itself. These terms apply to every file in the distribution - if you have questions, please contact the author.
|