Hi folks, I'm trying to implement AI:Categorizer. Everything works fine until I try to save and restore the state of the learner. >From the synopsis... my $nb = new AI::Categorizer::Learner::NaiveBayes(...parameters...); $nb->train(knowledge_set => $k); $nb->save_state ('filename'); --- later ---- $nb = AI::Categorizer::Learner::NaiveBayes->restore_state('filename'); my $c = new AI::Categorizer::Collection::Files( path => ... ); while (my $document = $c->next) { my $hypothesis = $nb->categorize($document); print "Best assigned category: ", $hypothesis->best_category, "\n"; print "All assigned categories: ", join(', ', $hypothesis->categories), "\n"; However when the line my $hypothesis = $nb->categorize($document); is executed I get the following error. Can't locate object method "predict" via package "Algorithm::NaiveBayes::Model::Frequency" at /usr/lib/perl5/site_perl/5.8.3/AI/Categorizer/Learner/NaiveBayes.pm line 28. It seems like inheritance is lost between save and restore states. Any ideas? Thanks in advance. PS: CC to email highly appreciated.
AI::Categorizer restore problem
PerlDiscuss - Perl Newsgroups and mailing lists Tue, 31 Aug 2004 04:45:05 -0700
- AI::Categorizer restore pr... PerlDiscuss - Perl Newsgroups and mailing lists
- Re: AI::Categorizer r... Ken Williams
- AI::Genetic greggallen
- Re: AI::Genet... Brad Larsen
- Re: AI::G... Benjamin Tucker