Grokbase Groups Perl ai May 2007
FAQ
hi, buddies,

I am not sure if i am in the right place. :-)

I am a fresh man to the perl and perl AI module.

I am trying to do the NaiveBayes experiments with the help of code demo.pl in
example of the module of AI::Categorizer.
Now I am confused about how to do the feature selection.

The documents say that KnowledgeSet::load( ) will do feature selection and
read the corpus at the same time. So, I change the construction of
KnowledgeSet in
demo.pl from
my $k = AI::Categorizer::KnowledgeSet->new( verbose => 1 );
$k->load( collection => $training )
to
my $k = AI::Categorizer::KnowledgeSet->new( verbose => 1 , features_kept =
5000 );
$k->load( collection => $training )

Then I re-run the code with expection to keep the top 5000 features with
high Document Frequency.
But it seems that there is no difference as before. do i misunderstand any
point ?

And also, is there any smoothing method implemented in
AI::Categorizer::Learner::NaiveBayes ?

Thanks for your attention

Jianmin

Search Discussions

  • Alan Gibson at May 24, 2007 at 2:24 am
    im not sure if this pertains to your problem exactly, but you probably
    want to specify the weighting method like

    my $k = AI::Categorizer::KnowledgeSet->new( verbose => 1 ,
    features_kept = 5000,
    tfidf_weighting=>'nfc'
    );

    the default weighting is 'xxx' which if i understand correctly doesnt
    actually do anything.

    alan

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupai @
categoriesperl
postedMay 19, '07 at 12:43p
activeMay 24, '07 at 2:24a
posts2
users2
websiteperl.org

2 users in discussion

Alan Gibson: 1 post Jianmin WU: 1 post

People

Translate

site design / logo © 2021 Grokbase