Skip Menu |

This queue is for tickets about the AI-Categorizer CPAN distribution.

Report information
The Basics
Id: 28749
Status: open
Priority: 0/
Queue: AI-Categorizer

People
Owner: Nobody in particular
Requestors: CHORNY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.09
Fixed in: (no value)



Subject: Can't take log of 0
Example script dies with Can't take log of 0 at c:/perl/site/lib/Statistics/Contingency.pm line 183. AI::Categorizer 0.09 Statistics::Contingency 0.06 -- Alexandr Ciornii, http://chorny.net
Subject: categ-log.pl
use strict; use warnings; use AI::Categorizer; my %data=( 'd1'=>{ categories => ['a'], content => 'excluding', } ); my %data1=( 'd2'=>{ content => 'including', } ); use AI::Categorizer::Collection::InMemory; my $training = AI::Categorizer::Collection::InMemory->new(data => \%data); my $test = AI::Categorizer::Collection::InMemory->new( data => \%data1 ); use AI::Categorizer::KnowledgeSet; use AI::Categorizer::Learner::NaiveBayes; #my $c = new AI::Categorizer(knowledge_set=>$c1); print "Loading training set\n"; my $k = AI::Categorizer::KnowledgeSet->new( verbose => 1 ); $k->load( collection => $training ); print "Training categorizer\n"; my $l = AI::Categorizer::Learner::NaiveBayes->new( verbose => 1 ); $l->train( knowledge_set => $k ); print "Categorizing test set\n"; my $experiment = $l->categorize_collection( collection => $test ); print $experiment->stats_table;
It was fixed in Statistics::Contingency 0.08. IMHO AI::Categorizer should depend on this version, not 0.06. -- Alexandr Ciornii, http://chorny.net
Thanks Alexandr. I haven't been able to keep up with my CPAN modules lately and I would very much welcome it if you're interested in maintaining it, or even just doing a release with some of the known problems. Let me know & I can grant you maintainer status on PAUSE and on the SVN repo. -Ken