Home > perl-ToyBox-XS-NaiveBayes

perl-ToyBox-XS-NaiveBayes

Perl-ToyBox-XS-NaiveBayes is a project mainly written in C and PERL, it's free.

NAME ToyBox::XS::NaiveBayes - Simple Naive Bayes using Perl XS

SYNOPSIS use ToyBox::XS::NaiveBayes;

  my $nb = ToyBox::XS::NaiveBayes->new();

  $nb->add_instance(
      attributes => {a => 2, b => 3},
      label => 'positive'
  );

  $nb->add_instance(
      attributes => {c => 3, d => 1},
      label => 'negative'
  );

  $nb->train(alpha => 1.0);

  my $probs = $nb->predict(
                  attributes => {a => 1, b => 1, d => 1, e =>1}
              );

DESCRIPTION This module implements a simple Naive Bayes using Perl XS.

AUTHOR TAGAMI Yukihiro [email protected]

LICENSE This library is distributed under the term of the MIT license.

<http://opensource.org/licenses/mit-license.php>
Previous:taswm