Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !/usr/bin/env perl
- use Modern::Perl;
- use Statistics::Contingency;
- use Data::Dumper;
- my $s = Statistics::Contingency->new( categories => [qw/spam ham virus marketing/] );
- my $t = [
- qw/spam spam/ x 1,
- qw/spam ham/ x 1,
- qw/ham ham/ x 2,
- ];
- while ( @$t ) {
- my ( $a, $c ) = (shift @$t, shift @$t);
- $s->add_result( $a, $c );
- }
- # will print:
- # +---------------------------------------------+
- # | maR maP maF1 miR miP miF1 Err |
- # | 0.917 0.875 0.867 0.750 0.750 0.750 0.125 |
- # +---------------------------------------------+
- print $s->stats_table;
Add Comment
Please, Sign In to add comment